paihengxu / QA-NER

An unofficial implementation of QANER

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QA-NER

An unofficial implementation of QANER

Install

The repo was tested with Python 3.8

# cuda 11.3
conda install pytorch==1.11.0 cudatoolkit=11.3 -c pytorch
pip install -r requirements

Run

Only supports running on CONLL03 (conll) and MIT restaurant (mit) datasets for now. Datasets are under data folder. See utils/arguments.py for detailed argument instructions.

Train

Train and test

python train.py --dataset mit --model-name "deepset/bert-large-uncased-whole-word-masking-squad2" --n 10 --num-negatives 2
python train.py --dataset conll --model-name "deepset/bert-large-uncased-whole-word-masking-squad2" --n 10 --num-negatives 0

Inference

Simply test/inference with a specified model

python inference.py --dataset mit --model-name "deepset/bert-large-uncased-whole-word-masking-squad2"

About

An unofficial implementation of QANER


Languages

Language:Python 100.0%