Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/victowang/wikigame
A python script to play the Wikipedia game
https://github.com/victowang/wikigame
nlp python spacy wikigame wikipedia-game
Last synced: about 1 month ago
JSON representation
A python script to play the Wikipedia game
- Host: GitHub
- URL: https://github.com/victowang/wikigame
- Owner: victowang
- Created: 2020-01-17T12:25:28.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-15T18:38:13.000Z (almost 5 years ago)
- Last Synced: 2024-11-09T16:46:54.064Z (3 months ago)
- Topics: nlp, python, spacy, wikigame, wikipedia-game
- Language: Python
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# A bot playing the Wikipedia game
This project uses **Python** to play the [WikiGame](https://en.wikipedia.org/wiki/Wikipedia:Wiki_Game)
automatically.## Strategies :
* **Random** : If the end page is not found, chooses a random link
_Unlikely to succeed_
* **With NLP** : Chooses the word closest to the target in the page using similarity computed with spacy
* **Max** : similarity is computed as the max similarity between words from the two strings
_Could get stuck in pages about Turkey (country) when trying to get to Bacon_
* **Mean** : Similarity is computed as the average similarity between words from the two strings
_Better when facing the previous issue_## Tools:
* `Request` to call the Wikipedia API
* `BeautifulSoup` to parse html
* `Spacy` to find similarities with NLP## Choose a spacy ressource :
Download ressource (https://spacy.io/models/en) :
* Small :
`python -m spacy download en_core_web_sm`
* Medium :
`python -m spacy download en_core_web_md`
* Large :
`python -m spacy download en_core_web_lg`In spacyTools.py choose between `'sm'`, `'md'` and `'lg'` by editing the following line :
`nlp = spacy.load('en_core_web_lg')`## Run :
`python main.py`## Example :
![Example](example.png)