alexgreene / wikiquiz Goto Github PK
View Code? Open in Web Editor NEWGenerates a quiz for a Wikipedia page using parts of speech and text chunking.
License: MIT License
Generates a quiz for a Wikipedia page using parts of speech and text chunking.
License: MIT License
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger pin code: 640-888-131
127.0.0.1 - - [19/Feb/2017 10:40:48] "GET /quiz/Honda/ HTTP/1.1" 500 -
Hello! I am encountering a problem where, a lot of the time, the console when doing python server.py
returns a 200 for an article, but it doesn't change the question field. What makes this even stranger is that it changes the title field!
This sounds like an amazing project ! Why don't you deploy this to Heroku or somewhere else to display a live demo of the quiz?
There are articles where it raises a 500 error in case it's unable to generate any questions.
For example, for "beer" (I added some lines to print the relevant exception traceback):
Traceback (most recent call last):
File "python/server.py", line 17, in get_quiz
for question in a.quiz.get_ten_random():
File "/Users/svisser/projects/WikiQuiz/python/Quiz.py", line 19, in get_ten_random
selected.append(random.choice(self.questions))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py", line 275, in choice
return seq[int(self.random() * len(seq))] # raises IndexError if seq is empty
IndexError: list index out of range
This is different from #1 as I'm able to run the project successfully for other articles (like "baseball").
I commented out lines 14, 27, 28 to see why it wouldn't work and I get this error.
File "WikiQuiz-master/python/server.py", line 15, in get_quiz a = Article(article_name) File "WikiQuiz-master/python/Article.py", line 19, in __init__ self.page.summary.encode('ascii', 'ignore')) File "WikiQuiz-master/python/Article.py", line 54, in generate_questions_for sec.replace(")", "("))[0::2]) TypeError: a bytes-like object is required, not 'str'
I printed 'sec' and I do get text from the Wiki article but it fails on the first call to generate_questions_for()
Technically, users aren't able to contribute to this project as there is no license. You might want to add one, whether it be MIT, BSD, Apache, or GPL.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.