Closed Helpme0822 closed 6 years ago
Could you post a screenshot of the problem?
Unfortunately I already closed the window :/
No problem. If this issue occurs again please screenshot it and post it in this issue.
I got again the issue and here is the screenshot of an example:
So?
now i just get this
That is incredibly strange. As for the "Server response not JSON" message, the HQ servers might be overloaded. I'll be looking into this issue further.
Okay but actually the thing with the json file is fine because it works again the problem is more with that what I send on the other picture
Yep, that's what I was saying above. The "Server response not JSON" is probably just due to HQ.
Okay keep me informed then if you have any news please
So any news?
I'm getting the following:
Show active, connecting to socket at https://ws-quiz.hype.space/ws/44151
Connected
Question detected.
Question 10 out of 12
In the Bible, which son of Jacob has the same mother as Joseph?
['Benjamin', 'Levi', 'Simeon']
Searching
['Benjamin', 'Levi', 'Simeon']
['bible', 'son', 'jacob', 'mother', 'joseph']
['https://en.wikipedia.org/wiki/Rachel', 'https://en.wikipedia.org/wiki/Jacob', 'https://en.wikipedia.org/wiki/Simeon_(son_of_Jacob)', 'http://www.aboutbibleprophecy.com/p34.htm', 'https://www.lds.org/scriptures/gs/joseph-son-of-jacob?lang=eng']
Running method 1
{'benjamin': 29, 'levi': 18, 'simeon': 57}
simeon
Traceback (most recent call last):
File "W:\HQ Trivia\HackQ-Trivia\hq_main.py", line 47, in <module>
asyncio.get_event_loop().run_until_complete(networking.websocket_handler(socket, headers))
File "C:\Users\Blah\AppData\Local\Programs\Python\Python36-32\lib\asyncio\base_events.py", line 467, in run_until_complete
return future.result()
File "W:\HQ Trivia\HackQ-Trivia\networking.py", line 66, in websocket_handler
print(await question.answer_question(question_str, answers))
File "W:\HQ Trivia\HackQ-Trivia\question.py", line 67, in answer_question
key_nouns.update(search.find_nouns(question, num_words=5, reverse=True))
File "W:\HQ Trivia\HackQ-Trivia\search.py", line 33, in find_nouns
tokens = word_tokenize(text)
File "C:\Users\Blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\nltk\tokenize\__init__.py", line 128, in word_tokenize
sentences = [text] if preserve_line else sent_tokenize(text, language)
File "C:\Users\Blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\nltk\tokenize\__init__.py", line 94, in sent_tokenize
tokenizer = load('tokenizers/punkt/{0}.pickle'.format(language))
File "C:\Users\Blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\nltk\data.py", line 834, in load
opened_resource = _open(resource_url)
File "C:\Users\Blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\nltk\data.py", line 952, in _open
return find(path_, path + ['']).open()
File "C:\Users\Blah\AppData\Local\Programs\Python\Python36-32\lib\site-packages\nltk\data.py", line 673, in find
raise LookupError(resource_not_found)
LookupError:
**********************************************************************
Resource [93mpunkt[0m not found.
Please use the NLTK Downloader to obtain the resource:
[31m>>> import nltk
>>> nltk.download('punkt')
[0m
Searched in:
- 'C:\\Users\\Blah/nltk_data'
- 'C:\\nltk_data'
- 'D:\\nltk_data'
- 'E:\\nltk_data'
- 'C:\\Users\\Blah\\AppData\\Local\\Programs\\Python\\Python36-32\\nltk_data'
- 'C:\\Users\\Blah\\AppData\\Local\\Programs\\Python\\Python36-32\\lib\\nltk_data'
- 'C:\\Users\\Blah\\AppData\\Roaming\\nltk_data'
- ''
**********************************************************************
>>> import nltk
>>> nltk.download("stopwords")
[nltk_data] Downloading package stopwords to
[nltk_data] C:\Users\Blah\AppData\Roaming\nltk_data...
[nltk_data] Package stopwords is already up-to-date!
True
>>> nltk.download("averaged_perceptron_tagger")
[nltk_data] Downloading package averaged_perceptron_tagger to
[nltk_data] C:\Users\Blah\AppData\Roaming\nltk_data...
[nltk_data] Package averaged_perceptron_tagger is already up-to-
[nltk_data] date!
True
Try downloading punkt as well. Will be adding this to the README.
How do you download it? I'm quite new to this. What I've done is create a file called requirements.txt and add the following in there:
aiohttp bs4 nltk unidecode
Then I run this: pip install -r requirements.txt
And it works fine. I tried doing the same thing by just adding punkt into requirements.txt and it says this:
Collecting punkt (from -r requirements.txt (line 1)) Could not find a version that satisfies the requirement punkt (from -r requirements.txt (line 1)) (from versions: ) No matching distribution found for punkt (from -r requirements.txt (line 1))
NVM, just saw your updated readme.
Any news for my problem @Exaphis ?
Still not working.
`Question detected. Question 10 out of 12 Workers throughout Victoria, Australia get a day off every November for what sporting event? ['Cricket match', 'Horse race', 'Rugby game']
Searching ['Cricket match', 'Horse race', 'Rugby game'] ['workers', 'throughout', 'victoria', 'australia', 'get', 'day', 'every', 'november', 'sporting', 'event'] ['http://www.traveller.com.au/no-contest-why-melbourne-is-the-nations-sporting-capital-gus8fc', 'http://www.visitmelbourne.com/United-Kingdom/Sports-and-events', 'http://www.visitvictoria.com/Events/Sports', 'https://en.wikipedia.org/wiki/Public_holidays_in_Australia', 'https://en.wikipedia.org/wiki/Victoria_(Australia)'] Server timeout/error to http://www.visitvictoria.com/Events/Sports Running method 1 {'cricket match': 0, 'horse race': 0, 'rugby game': 0} Running method 2 {'Cricket match': {'cricket': 11, 'match': 4}, 'Horse race': {'horse': 2, 'race': 12}, 'Rugby game': {'rugby': 8, 'game': 6}} Cricket match
[('Workers', 'NNS'), ('throughout', 'IN'), ('Victoria', 'NNP'), (',', ','), ('Australia', 'NNP'), ('get', 'VB'), ('a', 'DT'), ('day', 'NN'), ('off', 'IN'), ('every', 'DT'), ('November', 'NNP'), ('for', 'IN'), ('what', 'WP'), ('sporting', 'VBG'), ('event', 'NN'), ('?', '.')] Question nouns: ['australia', 'workers', 'victoria'] Running method 3 Search processed URLs fetched
Cricket match: {'australia': 59, 'workers': 0, 'victoria': 0} Horse race: {'australia': 16, 'workers': 0, 'victoria': 1} Rugby game: {'australia': 28, 'workers': 0, 'victoria': 0}
Keyword scores: {'Cricket match': 75, 'Horse race': 64, 'Rugby game': 73} Noun scores: {'Cricket match': 59, 'Horse race': 17, 'Rugby game': 28} Cricket match Search took 9.303157091140747 seconds
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init.py", line 994, in emit
stream.write(msg)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f45f' in position 151: character maps to
Show active, connecting to socket at https://ws-quiz.hype.space/ws/44171
Connected
--- Logging error ---
Traceback (most recent call last):
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\logging__init.py", line 994, in emit
stream.write(msg)
File "C:\Users\blah\AppData\Local\Programs\Python\Python36-32\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 151-164: character maps to
@chaoscreater, the issue should be fixed in commit https://github.com/Exaphis/HackQ-Trivia/commit/06fce8d8a6490a13d29e55df4e99b159ce05f412. Please create a new issue if the problem persists.
@Helpme0822 I have added a new debugging measure for your issue. Update this issue with your log file when the problem happens again.
@Exaphis thanks is it also possible to somehow connect this bot to the UK version of HQ Trivia I tried to enter the Bearer Token and ID of an UK user but i'm still connected on the US HQ Trivia
I have no clue how to connect to the UK version of HQ since I am in the US. Any help would be appreciated.
No response for 6 days, assuming solved. Let me know if this issue occurs again.
Hey I just tried your trivia bot but for every answer i always got 0 matches i think something was wrong with the searching urls could you please help me