Code Monkey home page Code Monkey logo

xref-chinese-el's Introduction

XREF

This repository contains code and links to data for our AKBC 2020 paper:

XREF: Entity Linking for Chinese News Comments with Supplementary Article Reference
Xinyu Hua, Lei Li, Lifeng Hua, and Lu Wang. AKBC 2020

Data

link

Environment

  • python 3.7
  • pytorch 1.5
  • pytorch-lightning 0.8

Training

The following script will train XRef model for 10 epochs with batch size 32. It will dump checkpoints every 1 epoch, with the top 5 ones (base on validation loss) saved. (we assume the data is stored under ./data/.)

python train.py --domain=[ent,product] \
    --ckpt-dir=model/demo/ \
    --batch-size=32 \
    --model=xref \
    --tensorboard-dir=demo \
    --save-interval=1 \
    --save-topk=5 \
    --max-train-epochs=10

Inference

The following script loads the latest checkpoint from --ckpt-dir and run inference over the test set. The results will be saved to --output-path.

python infer.py --domain=[ent,product] \
    --output-path=demo.jsonl \
    --ckpt-dir=model/demo/ \

License

See the LICENSE file for details.

xref-chinese-el's People

Contributors

xinyuhua avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

xref-chinese-el's Issues

AssertionError: ./data/entity.dict does not exist!

数据文件中缺少entity.dict文件~
python train.py --domain=ent\
--ckpt-dir=model/demo/
--batch-size=32
--model=xref
--tensorboard-dir=demo
--save-interval=1
--save-topk=5
--max-train-epochs=10

Traceback (most recent call last):
File "train.py", line 80, in
main()
File "train.py", line 53, in main
model = model_class(args)
File "/home/pc/disk_2T/pc/jupyter/dahuzi666/XREF/xref-chinese-el-master/models/xref.py", line 14, in init
super().init(hparams)
File "/home/pc/disk_2T/pc/jupyter/dahuzi666/XREF/xref-chinese-el-master/models/model.py", line 22, in init
self.entity_dict = Vocab(dict_path=hparams.ent_vocab_path)
File "/home/pc/disk_2T/pc/jupyter/dahuzi666/XREF/xref-chinese-el-master/vocab.py", line 7, in init
assert os.path.exists(dict_path), f"{dict_path} does not exist!"
AssertionError: ./data/entity.dict does not exist!

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.