Comments (8)
Hi ZengYoufeng,
the corresponding vocabulary file is already included for the models we trained on the CoNLL04, ADE and SciERC datasets (under "./data/models" after executing "./scripts/fetch_models.sh"). If you want to train a model from-scratch, you should have a look at the "transformers" (https://github.com/huggingface/transformers) library we are using. You can either specify one of the pre-trained BERT models included in "transformers" as both the "model_path" and "tokenizer_path" (e.g. "bert-base-cased" as in "configs/example_train.conf") or point "model_path" and "tokenizer_path" to a directory that contains model weights or a vocabulary file respectively.
from spert.
Did you train your own model on the self-built dataset or where is 'pytorch_model.bin' from? You should use the same 'vocab.txt' file that was used while training 'pytorch_model.bin'.
from spert.
You should use the same 'vocab.txt' file that was used during training. In your case, this is probably the one located in 'data/models/conll04'. So just set 'tokenizer_path' in 'example_eval.conf' to point to 'data/models/conll04'. This is not a vocabulary file specifically created for the CoNLL04 dataset, but the rather generic 'bert-base-cased' vocabulary (see the transformers library documentation).
from spert.
Did you train your own model on the self-built dataset or where is 'pytorch_model.bin' from? You should use the same 'vocab.txt' file that was used while training 'pytorch_model.bin'.
I have trained my own model on the self-built dataset on the same training settings of the CoNLL04 dataset. Then, I got three files, 'pytorch_model.bin', 'config.json' and 'extra.state', respectively. However, I can't find the file 'vocab.txt'. Therefore, I cannot execute the command 'python ./spert.py eval --config configs/example_eval.conf'. I want to know how to get the file 'vocab.txt' that fits self-built dataset.
Please refer to the use of huggingface/transformers!!!!!!
from spert.
Hi ZengYoufeng,
the corresponding vocabulary file is already included for the models we trained on the CoNLL04, ADE and SciERC datasets (under "./data/models" after executing "./scripts/fetch_models.sh"). If you want to train a model from-scratch, you should have a look at the "transformers" (https://github.com/huggingface/transformers) library we are using. You can either specify one of the pre-trained BERT models included in "transformers" as both the "model_path" and "tokenizer_path" (e.g. "bert-base-cased" as in "configs/example_train.conf") or point "model_path" and "tokenizer_path" to a directory that contains model weights or a vocabulary file respectively.
Thanks for your answer, I have got the trained model 'pytorch_model.bin' with self-built dataset, but I cannot execute the command 'python ./spert.py eval --config configs/example_eval.conf' successfully due to the lack of the file 'vocab.txt'. Now I want to know how to generate a vocabulary file that fits self-built dataset for evaluation. Hope you can give me some detailed guidance, I will be grateful!
from spert.
Did you train your own model on the self-built dataset or where is 'pytorch_model.bin' from? You should use the same 'vocab.txt' file that was used while training 'pytorch_model.bin'.
I have trained my own model on the self-built dataset on the same training settings of the CoNLL04 dataset. Then, I got three files, 'pytorch_model.bin', 'config.json' and 'extra.state', respectively. However, I can't find the file 'vocab.txt'. Therefore, I cannot execute the command 'python ./spert.py eval --config configs/example_eval.conf'. I want to know how to get the file 'vocab.txt' that fits self-built dataset.
from spert.
I understand that the file 'vocab.txt' is related to the language representation model, not to the dataset. I observed that the vocabulary files corresponding to the three datasets were different, so I misunderstood that the vocabulary file corresponds to the dataset and was generated by it. I'm so sorry for the misunderstanding and thank you very much for your kind help.
from spert.
No need to be sorry, I'm glad I could help you. The vocabulary files differ because we used SciBERT, which is accompanied by its own vocabulary, instead of BERT-Base-Cased for the SciERC dataset. The ADE and CoNLL04 models were trained using the same BERT-Base-Cased vocabulary.
from spert.
Related Issues (20)
- How to easily use this model for inference HOT 3
- Can't make predictions following the example HOT 8
- Help! Help! HOT 1
- Help, HOT 6
- How to call only the relation classifier on a pair of entities? HOT 2
- What is the meaning of the dataset tensors? HOT 1
- Simple example issue HOT 1
- Parts of entities are recognised separately HOT 3
- How does span filtering work? HOT 3
- Runtime Error HOT 1
- RuntimeError: copy_if failed to synchronize: cudaErrorAssert: device-side assert triggered HOT 4
- Does SpERT work with GPT models? HOT 1
- How to prepare dataset for training the model? HOT 9
- Can't download datasets
- TypeError: 'NoneType' object is not callable HOT 1
- Can't make train following the example
- Trained model : Relation classification is bad
- HELP HOT 1
- Extract entities and relation from Spacy tokens?
- [WARNI] NaN or Inf found in input tensor. 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 spert.