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
6591af12
Commit
6591af12
authored
Dec 04, 2012
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue with invalid text types
parent
bb934d32
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
1 deletions
+52
-1
deployment_steps.txt
+40
-1
essay_set.py
+12
-0
No files found.
deployment_steps.txt
View file @
6591af12
Machine learning step
:
Old steps (deprecated)
:
source opt/edx/bin/activate
sudo apt-get upgrade gcc
...
...
@@ -14,6 +14,8 @@ sudo su makeitso
django-admin syncdb
django-admin migrate
sudo su makeitso
bash
source /opt/edx/bin/activate
...
...
@@ -22,9 +24,46 @@ pip install numpy
pip install -r requirements.txt
cd opt/wwc/machine-learning
pup install -r requirements.txt
python -m nltk.downloader maxent_treebank_pos_tagger wordnet
python /opt/wwc/grading-controller/manage.py update_users
Copy auth.json and env.json into the grading-controller folder (no idea why this is needed, but django-admin doesn't find them at ENV_ROOT)
chown grading-controller/edx.log to makeitso
make db file (for sqlite)
chown db file to makeitso
For some reason, have to copy auth.json and env.json to both opt/wwc/grading-controller and opt/wwc/ dirs
sudo apt-get install super
pip install MySQL-python
How to run:
/opt/edx/bin/gunicorn --preload -b 127.0.0.1:8000 -w 4 --timeout=300 --pythonpath=/opt/wwc/grading-controller grading_controller.wsgi
Upstart tasks:
grader
ml_grader
ml_creator
pull_from_xqueue
expire_old
"DATABASES": {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "sandbox_grader",
"USERNAME": "sandbox_grader",
"PORT": "3306",
"PASSWORD": "faarg16ren",
"HOST": "sandbox.rds.edx.org"
}
},
essay_set.py
View file @
6591af12
...
...
@@ -8,6 +8,7 @@ import nltk
import
sys
import
random
import
os
import
logging
base_path
=
os
.
path
.
dirname
(
__file__
)
sys
.
path
.
append
(
base_path
)
...
...
@@ -16,6 +17,8 @@ import util_functions
if
not
base_path
.
endswith
(
"/"
):
base_path
=
base_path
+
"/"
log
=
logging
.
getLogger
(
__name__
)
MAXIMUM_ESSAY_LENGTH
=
20000
class
EssaySet
(
object
):
...
...
@@ -53,6 +56,15 @@ class EssaySet(object):
else
:
max_id
=
0
# Verify that essay_score is an int, essay_text is a string, and essay_generated equals 0 or 1
try
:
#Try conversion of types
essay_score
=
int
(
essay_score
)
essay_text
=
str
(
essay_text
)
except
:
#Nothing needed here, will return error in any case.
log
.
exception
(
"Invalid type for essay score : {0} or essay text : {1}"
.
format
(
type
(
essay_score
),
type
(
essay_text
)))
if
type
(
essay_score
)
==
type
(
0
)
and
type
(
essay_text
)
==
type
(
"text"
)
\
and
(
essay_generated
==
0
or
essay_generated
==
1
):
self
.
_id
.
append
(
max_id
+
1
)
...
...
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