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
365a3810
Commit
365a3810
authored
Dec 03, 2012
by
Diana Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add exception logging when model creation fails
parent
93c879dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
create.py
+11
-3
No files found.
create.py
View file @
365a3810
import
os
import
sys
import
logging
log
=
logging
.
getLogger
(
__name__
)
base_path
=
os
.
path
.
dirname
(
__file__
)
sys
.
path
.
append
(
base_path
)
...
...
@@ -19,18 +21,24 @@ def create(text,score,prompt_string,model_path):
try
:
e_set
=
model_creator
.
create_essay_set
(
text
,
score
,
prompt_string
)
except
:
results
[
'errors'
]
.
append
(
"essay set creation failed."
)
msg
=
"essay set creation failed."
results
[
'errors'
]
.
append
(
msg
)
log
.
exception
(
msg
)
try
:
feature_ext
,
classifier
,
cv_error_results
=
model_creator
.
extract_features_and_generate_model
(
e_set
)
results
[
'cv_kappa'
]
=
cv_error_results
[
'kappa'
]
results
[
'cv_mean_absolute_error'
]
=
cv_error_results
[
'mae'
]
except
:
results
[
'errors'
]
.
append
(
"feature extraction and model creation failed."
)
msg
=
"feature extraction and model creation failed."
results
[
'errors'
]
.
append
(
msg
)
log
.
exception
(
msg
)
try
:
model_creator
.
dump_model_to_file
(
prompt_string
,
feature_ext
,
classifier
,
text
,
score
,
model_path
)
results
[
'success'
]
=
True
except
:
results
[
'errors'
]
.
append
(
"could not write model to: {0}"
.
format
(
model_path
))
msg
=
"could not write model to: {0}"
.
format
(
model_path
)
results
[
'errors'
]
.
append
(
msg
)
log
.
exception
(
msg
)
#Count number of successful/unsuccessful creations
statsd
.
increment
(
"open_ended_assessment.machine_learning.creator_count"
,
...
...
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