Comments (1)
1 默认就能够使用GPU训练和预测,并已在1080Ti和2080Ti上成功运行多次,如不能使用,请检查显卡驱动,CUDA版本与torch版本是否对应。
2 调用copyrnn\predict.py
# Your model path
model_path = 'data/models/model.model'
# your vocab path
vocab_path = 'data/vocab_kp20k.txt'
keyword_generator = CopyRnnPredictor({'model': model_path},
vocab_info=vocab_path,
beam_size=50,
max_target_len=5,
max_src_length=800)
# test some single cases, or use as component in online service
tokens = ['numerous', 'studies', 'have', 'demonstrated', 'that', 'h2o2-induced', 'apoptosis', 'is', 'mediated', 'by', 'activation', 'of', 'mapks']
keyword_generator.predict([tokens], delimiter=' ', tokenized=True)
# evaluate file
from munch import Munch
src_filename = 'data/nus.jsonl'
dest_filename = 'data/nus_pred.jsonl'
config = read_json('data/models/model.json')
keyword_generator.eval_predict(src_filename, dest_filename,args=Munch(config))
from deep-keyphrase.
Related Issues (11)
- pk20k数据集下载链接失效了 HOT 1
- generation_logits = torch.cat([generation_logits, generation_oov_logits], dim=1) RuntimeError: Sizes of tensors must match except in dimension 1. Expected size 49999 but got size 100 for tensor number 1 in the list.
- 请问如何使用不带copy_net的版本? HOT 4
- 运行脚本出错 HOT 2
- how to run HOT 1
- 运行train出错 HOT 2
- error HOT 4
- 请问训练一次要多久 HOT 1
- OSError: [Errno 12] Cannot allocate memory HOT 4
- 关于最后的test与evaluate HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deep-keyphrase.