Skip to content

Hackathon project - a Q&A engine using BERT model

License

Notifications You must be signed in to change notification settings

manuelzander/bert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BERT Q&A engine

status last-commit issues-pr-raw python license

Prerequisites

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

The code is run and tested with Python 3.7.4 on macOS 10.14.6.

Environment

Clone the repo to your local machine.

Create a virtual environment for Python 3 with:

virtualenv -p python3 env

Activate the virtual environment with:

source env/bin/activate

Install the required Python packages with:

pip install -r requirements.txt

You will also need https://github.com/huggingface/transformers.

Within the source folder, run:

git clone git@github.com:huggingface/transformers.git

Model

The pre-trained model object can be downloaded from:

https://drive.google.com/open?id=1UbhMvtUeX1LiRA9uDiontnOgqps1ooy5

Create a folder source/bert and unzip the model in there.

Running the flask server

Run python3 source/main.py and open http://127.0.0.1:5000/

If you just want to pass a question and a context to the model, run:

python3 source/modelling/repl.py --question question --context context