This project use Name Entity Recognition to get insights from Restaurants' reviews.
- python==3.8.5
- numpy==1.19.2
- pandas==1.2.0
- pytorch==1.7.1
- transformers==4.2.2
- streamlit==0.75.0
(*) For a complete revision, please check environment.yml file.
- Windows 10: OK
- All linux-based os: OK
-
Clone repository and move to directory:
git clone https://github.com/dpalominop/NERForRestaurants.git && cd NERForRestaurants
-
Create and activate a virtual environment (I recommend to use conda):
conda env create -f environment.yml
conda activate ner
-
Run the web application:
streamlit run app.py
-
Open a browser and write in url:
localhost:8051
(*) These steps are intended only to pretrain or finetune a model from a previous one.
-
Open config.yml and change value of stage to devel:
stage: "devel"
-
Install git-lfs to run long files:
sudo apt-get install git-lfs
-
Select a model from https://huggingface.com/models and clone in your local directory:
cd models && git lfs install && git clone https://huggingface.co/{user_name}/{model_name}
-
Set the pretrained model to use in src/config.py:
BASE_MODEL_PATH = "../models/{model_name}"
-
Set the dataset to use in src/config.py:
TRAINING_FILE = "../datasets/reviews.csv"
-
Train your custom model:
cd ../src && python train.py
-
Use your new custom model to predict tags in a text:
python predict.py
Temporarily, the web application will be hosted in https://f8e1b44954ff.ngrok.io
Please, contact me to: [email protected]