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
80c2731c
Commit
80c2731c
authored
Nov 30, 2012
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix naming, other formatting
parent
d81b4306
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
feature_extractor.py
+7
-5
grade.py
+1
-3
No files found.
feature_extractor.py
View file @
80c2731c
...
...
@@ -213,7 +213,9 @@ class FeatureExtractor(object):
#Iterate through essays and create a feedback dict for each
all_feedback
=
[]
for
m
in
xrange
(
0
,
len
(
e_set
.
_text
)):
individual_feedback
=
{
'grammar'
:
"Ok."
,
'spelling'
:
"Ok."
,
'topicality'
:
"Ok."
,
'markup_text'
:
""
,
'prompt_overlap'
:
"Ok."
}
individual_feedback
=
{
'grammar'
:
"Grammar: Ok."
,
'spelling'
:
"Spelling: Ok."
,
'topicality'
:
"Topicality: Ok."
,
'markup_text'
:
""
,
'prompt_overlap'
:
"Prompt Overlap: Ok."
}
markup_tokens
=
e_set
.
_markup_text
[
m
]
.
split
(
" "
)
#This loop ensures that sequences of bad grammar get put together into one sequence instead of staying
...
...
@@ -231,9 +233,9 @@ class FeatureExtractor(object):
#Display messages if grammar/spelling errors greater than average in training set
if
set_grammar_per_character
[
m
]
>
(
self
.
_grammar_errors_per_character
*
modifier_ratio
):
individual_feedback
[
'grammar'
]
=
"More grammar errors than average."
individual_feedback
[
'grammar'
]
=
"
Grammar:
More grammar errors than average."
if
set_spell_errors_per_character
[
m
]
>
(
self
.
_spell_errors_per_character
*
modifier_ratio
):
individual_feedback
[
'spelling'
]
=
"More spelling errors than average."
individual_feedback
[
'spelling'
]
=
"
Spelling:
More spelling errors than average."
#Test topicality by calculating # of on topic words per character and comparing to the training set
#mean. Requires features to be passed in
...
...
@@ -241,10 +243,10 @@ class FeatureExtractor(object):
f_row_sum
=
numpy
.
sum
(
features
[
m
,
12
:])
f_row_prop
=
f_row_sum
/
len
(
e_set
.
_text
[
m
])
if
f_row_prop
<
(
self
.
_mean_f_prop
/
1.5
)
or
len
(
e_set
.
_text
[
m
])
<
20
:
individual_feedback
[
'topicality'
]
=
"Essay may be off topic."
individual_feedback
[
'topicality'
]
=
"
Topicality:
Essay may be off topic."
if
(
features
[
m
,
9
]
>.
5
):
individual_feedback
[
'prompt_overlap'
]
=
"Too much overlap with prompt."
individual_feedback
[
'prompt_overlap'
]
=
"
Prompt Overlap:
Too much overlap with prompt."
log
.
debug
(
features
[
m
,
9
])
#Create string representation of markup text
...
...
grade.py
View file @
80c2731c
...
...
@@ -76,12 +76,10 @@ def grade(grader_path,grader_config,submission,sandbox=None):
#Add feedback to results
results
[
'feedback'
]
=
{
'topicality'
:
feedback
[
'topicality'
],
'prompt-overlap'
:
feedback
[
'prompt_overlap'
],
'spelling'
:
feedback
[
'spelling'
],
'grammar'
:
feedback
[
'grammar'
],
'markup-text'
:
feedback
[
'markup_text'
],
'problem-areas'
:
problem_areas
,
'score'
:
results
[
'score'
],
'prompt-overlap'
:
feedback
[
'prompt_overlap'
],
}
else
:
...
...
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