Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
ease
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
ease
Commits
97de6844
Commit
97de6844
authored
Jun 23, 2014
by
Will Daly
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #59 from edx/will/optimize-good-ngram-lookup
Use a set instead of a list for good ngram lookup
parents
a990b25e
94014b71
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
ease/feature_extractor.py
+3
-3
No files found.
ease/feature_extractor.py
View file @
97de6844
...
...
@@ -74,8 +74,8 @@ class FeatureExtractor(object):
def
get_good_pos_ngrams
(
self
):
"""
Gets a
lis
t of gramatically correct part of speech sequences from an input file called essaycorpus.txt
Returns the
lis
t and caches the file
Gets a
se
t of gramatically correct part of speech sequences from an input file called essaycorpus.txt
Returns the
se
t and caches the file
"""
if
(
os
.
path
.
isfile
(
NGRAM_PATH
)):
good_pos_ngrams
=
pickle
.
load
(
open
(
NGRAM_PATH
,
'rb'
))
...
...
@@ -92,7 +92,7 @@ class FeatureExtractor(object):
'NNP .'
,
'NNP . TO'
,
'NNP . TO NNP'
,
'. TO'
,
'. TO NNP'
,
'. TO NNP NNP'
,
'TO NNP'
,
'TO NNP NNP'
]
return
good_pos_ngrams
return
set
(
good_pos_ngrams
)
def
_get_grammar_errors
(
self
,
pos
,
text
,
tokens
):
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment