Coder Social home page Coder Social logo

KeyError: u'S-PRT' about tagger HOT 3 CLOSED

glample avatar glample commented on September 27, 2024
KeyError: u'S-PRT'

from tagger.

Comments (3)

glample avatar glample commented on September 27, 2024

Hi,

This is indeed not in the words, this is supposed to be a tag. I don't see where this can happen though. Can you provide the complete traceback error?

from tagger.

minhson-kaist avatar minhson-kaist commented on September 27, 2024

Hi,

I can finally understand the problem and solve it. This is because of the lack of PRT label in the dev or test set. I just copy a small part of training and testing set in the conll2002 data so this problem happened.

Thank you for your responding.

Regards.

from tagger.

IsabelMeraner avatar IsabelMeraner commented on September 27, 2024

Is there a workaround if a tag does not occur in both training and test/dev set?
I am using k-fold crossvalidation to split my small dataset and there is 1 fold where all occurrences of a certain low-frequent tag occur only in the test set and not in the training set.

The error I get looks like this:

Found 8 unique named entity tags
Traceback (most recent call last):
File "train.py", line 191, in
test_sentences, word_to_id, char_to_id, tag_to_id, lower
File "./../tagger/loader.py", line 146, in prepare_dataset
tags = [tag_to_id[w[-1]] for w in s]
KeyError: u'B-lat_fam'

Do you have any suggestions @glample ?
Thank you so much.

from tagger.

Related Issues (20)

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.