Skip to content

victowang/WikiGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A python script to play the Wikipedia game

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages