Comments (1)
Hi,
The data is in the following format:
TOKEN NNP B-NP O
So after the word_tokenize in the for loop, only the first element, the token, is given a 1 for masking. This will mask everything, but not the token on the first position (see 'attention_mask' on https://huggingface.co/transformers/model_doc/bert.html#bertmodel)
The first 'i' is maybe optional, but probably there for creating an iterator with the enumerate. The second and third 'i' are probably there to reduce the number of variables.
Hope this helps.
from bert-ner.
Related Issues (20)
- How to convert all cpp,header files to DLL file? HOT 1
- Error index out of range in self when trying to predict for text of close to 5000 characters HOT 1
- how convert bin to two part model? HOT 1
- How to predict on test dataset after training? HOT 1
- What is the data your model trained on? HOT 2
- Detokenizing the words HOT 1
- KeyError: '' HOT 1
- How can i make fine tuning with new entities/labels? HOT 1
- CUDA Runtime Error: Which Cuda version is compatible to run NER task using BERT-NER
- Key error 0 on evaluation set HOT 1
- Reproduce CoNLL results HOT 2
- RuntimeError : during model.predict() HOT 1
- Train your own model (colab)
- Pre-processing steps
- After training and saved the models, I got a valid accuracy, while got an error(bad) result based on loading the saved model. HOT 1
- How to show only the keywords in inference?
- How can i use this project in Chinese NER? HOT 1
- Understanding the Evaluation Code HOT 1
- Model training does not work on CPU 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 bert-ner.