kyubyong / bert_ner Goto Github PK
View Code? Open in Web Editor NEWNer with Bert
Ner with Bert
Data download link invalid.
thank you!!!
In bert paper, it seems that the words start with '##' should not be predicted. And you did compute is_head variable, but why this variable is not used when computing loss ?
The data download link is invalid. can you upload another connection? tank you very much
hi,
Thank you for sharing the code. But I can not find the file 'pytorch_pretrained_bert.py', hence I could not run the code.
Please tell how can I find the file 'pytorch_pretrained_bert.py'. Thanks
My requirement here is given a sentence(sequence), I would like to just extract the entities present in the sequence without classifying them to a type in the NER task. I see that BertForTokenClassification for NER does the classification. Can this be adapted for just the extraction?
Can you give me an idea of how to do entity extraction/identification using BERT?
We know that when loading pretrained bert, max_seqence=512, but when you are dealing with the sentences from data set, each sentence is padding based on the longest sentence of the batch, but I don't see you do truncate when the sequence longer than 512 lengths?
Thanks
Hi,
I was wondering how you are actually calculating your scores.
y_true = np.array([hp.tag2idx[line.split()[1]] for line in open(f, 'r').read().splitlines() if len(line) > 0])
y_pred = np.array([hp.tag2idx[line.split()[2]] for line in open(f, 'r').read().splitlines() if len(line) > 0])
num_proposed = len(y_pred[y_pred>1])
num_correct = (np.logical_and(y_true==y_pred, y_true>1)).astype(np.int).sum()
num_gold = len(y_true[y_true>1])
precision = num_correct / num_proposed
recall = num_correct / num_gold
Can you explain what the above code means?
How does this translate to say recall = TP / TP + FN? Don't you have to use some multi-class method?
Also, why are you only taking the index where y_true>1? Is it because you do not want the Other tag to skew your results? Thanks!
Can I use other datasets on this model?
I'm getting the following error when i try to run the finetuning example:
RuntimeError: CUDA out of memory. Tried to allocate 85.00 MiB (GPU 0; 4.00 GiB total capacity; 3.04 GiB already allocated; 9.21 MiB free; 15.31 MiB cached)
Reducing the batch_size didn't help.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.