Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 1.27 KB

readme.md

File metadata and controls

38 lines (29 loc) · 1.27 KB

A bot playing the Wikipedia game

This project uses Python to play the WikiGame 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