diff --git a/.gitignore b/.gitignore index ec329f8..4af7271 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,8 @@ nosetests.xml # Mr Developer .mr.developer.cfg .project -.pydevproject \ No newline at end of file +.pydevproject + +*.parse +*.osent +*.sst \ No newline at end of file diff --git a/ask b/ask index e814113..e23a223 100755 --- a/ask +++ b/ask @@ -5,14 +5,18 @@ # Useful tools which should be pre-installed import os, sys, errno +import subprocess import re import itertools import nltk +from nltk.stem import PorterStemmer +import bs4 # Import our modules from /modules sys.path.append("modules") import questionContentSelector import questionFromSentence +import coref if __name__ == '__main__': path_to_article = sys.argv[1] @@ -20,7 +24,9 @@ if __name__ == '__main__': # print("Generating " + str(num_questions) + " questions:") # Pre-process article content. - article_content = open(path_to_article).read() + #article_content = open(path_to_article).read() + #print (article_content) + article_content = coref.process(path_to_article) # Should probably apply co-reference resolution to article content here. diff --git a/modules/questionFromSentence.py b/modules/questionFromSentence.py index 0bb670e..caaf3dd 100644 --- a/modules/questionFromSentence.py +++ b/modules/questionFromSentence.py @@ -35,7 +35,8 @@ def transform(sentence): tokens = nltk.word_tokenize(sentence) posTag = nltk.pos_tag([tokens[0]])[0] - add_why = (random.randint(0,1) == 1) + #add_why = (random.randint(0,1) == 1) + add_why = 0 #if (tokens[1].upper() in BEING and posTag == 'PRP'): if (len(tokens) > 1 and tokens[1].upper() in BEING):