Giter Site home page Giter Site logo

barufa / triviasolver Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 196.71 MB

A question answering system developed in python focused on solving trivia questions that apply techniques of natural language processing and web scraping.

License: GNU General Public License v3.0

Python 97.80% Shell 0.84% Makefile 1.35%
question-answering trivia webscraping hqtrivia hqtriviahack ingame ingame-script google-vision-api cashshow triviabot

triviasolver's Introduction

TriviaBot

A question answering system developed in python focused on solving trivia questions that apply techniques of natural language processing and web scraping. This program is focused on the app InGame, but it also works with other trivia apps such as HQTrivia, CashShow and TriviaLive(Preguntados).

Its accuracy for the InGame application is 86%, which means that it gets just over 10 correct answers every 12 questions.

Getting Started

First of all, you have to download this repository and execute:

$ git clone https://github.com/barufa/TriviaBot.git
$ cd TriviaSolver

In order to install the program, you need to:

  • Install pipenv and tesseract
  • Install all program dependences and models of spacy
  • Test the program

For this purpose there is a simple makefile in the repository:

$ make dependences
$ make install
$ make test
$ make clean

If everything ends correctly, the program is ready to be used.

It is highly recommended to use Google Cloud to avoid character recognition errors. For this it is necessary to create an account in Google Cloud and register in the services of Google Cloud Vision. You can get more information here.

How it works:

This project uses python 3.6. In particular the packages/libraries used are...

  • nltk
  • regex
  • unidecode
  • mypy
  • urllib3
  • lxml
  • requests
  • google-cloud
  • pytesseract
  • opencv-python

To make the handling of dependencies easier, we use pipenv.

Usage

Once the program is installed, it can be executed through the following commands:

$ pipenv shell
$ cd code/
$ python3 TriviaBot.py [OPTIONS]

Where options are:

  • --help: Show this help message and exit
  • --Game: Game interface. The possible values are: InGame, HQTrivia, CashShow, TriviaLive.
  • --Search: Search engine that will use the program. The possible values are: Google, Ask, Bing, Combine, Metacrawle.
  • --Method: Main method used to solve the trivia. The available methods are: SimpleSearch, PageScrape, WikipediaSearch, CompleteSearch.
  • --OCR: Character recognition engine to be used. The possible values are: FreeOCR, Tesseract, GoogleVision.
  • --Source: Source from which the trivia will be obtained
  • --Language: Language in which you want to run the program. The possible values are: Spa (Spanish), Eng (English).

An example:

python3 TriviaBot.py --Source=../questions/InGame/1.png+../questions/InGame/2.png --Game=InGame --OCR=Tesseract

Screenshots

WORK IN PROGRESS

triviasolver's People

Contributors

barufa avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.