Math-aware QA system
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 42 commits ahead of kaushal2161:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
apicache
evaluation
fonts
static
templates
.gitignore
Example Questions
README.md
app.py
dependencies-ppp.sh
example_config.json
getformula.py
getidentifiers.py
getparts.py
identifier_properties.py
latexformlaidentifiers.py
requirements.txt

README.md

Math-aware QA system

This system is able to answer mathematical questions asked in natural language by the user.

System setup

sudo apt-get install python3
virtualenv -p python3 venv
source venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
./dependencies-ppp.sh
python app.py

CoreNLP

CoreNlp is resposible for extraction Triple (subject, predicate, object) from the questions.

  1. Downloading POS Tagger
wget http://nlp.stanford.edu/software/stanford-postagger-full-2015-12-09.zip
  1. Installing POS Tagger
unzip stanford-postagger-full-2015-12-09.zip
  1. Cloning and installing CoreNLP
git clone https://github.com/stanfordnlp/CoreNLP.git
cd CoreNLP
ant compile
ant jar
cd ..
  1. Downloading English model for CoreNLP
wget http://nlp.stanford.edu/software/stanford-english-corenlp-2016-01-10-models.jar

Pywikiwot

Pywikibot is used to extract the formula from Wikidata https://tools.wmflabs.org/pywikibot/

latex2sympy-master

Used to convert variant of latex formula to sympy equivalent form.

ANTLR is used to generate the parser:

sudo apt-get install antlr4

For latex2sympy download from https://github.com/augustt198/latex2sympy

sympy

apt-get install python3-sympy

ppp_modules

pip3 install --user ppp_questionparsing_grammatical
pip3 install git+https://github.com/ProjetPP/PPP-datamodel-Python.git
pip3 install git+https://github.com/ProjetPP/PPP-libmodule-Python.git

xmltodic

pip3 install xmltodict

flask

pip3 install Flask

After installing all the libraries follow the steps to run the Math-aware QA system:

  1. run the CoreNLP Server
Mathaware-Q-A-System/CoreNLP$ java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 &
SERVER_PID=$!
  1. run the flask server
Mathaware-Q-A-System$ export FLASK_APP=app.py
Mathaware-Q-A-System$ flask run

Then you can see the the system in your browser by opening the localhost which is : http://127.0.0.1:5000/