Coder Social home page Coder Social logo

bert_ner's Issues

The ##word should not be predicted

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 ?

can not find the file pytorch_pretrained_bert.py

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

F1, recall and precision calculation

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!

datasets

Can I use other datasets on this model?

Cuda out of memory error for finetuning

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.

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.