Skip to content

Homework 2 Viterbi Task, Bad Assert #6

Open

Description

@pcsiszar

When asserting for the POS tags of the sentence: " The cat walks. " the assert statement flags the as NNP
#quoted from homework 2
tags = run_viterbi("The cat runs .")
print(tags)
assert tags == ['NNP', 'NN', 'VBZ', '.']

In actuality, the "The" part is supposed to be a DT, determiner, not an NNP, a proper noun.
I also checked this with spacy, it came up with the same result:
code:
sent = "The cat walks."
s = nlp(sent)
for token in s:
print(token.pos_)

Results:

DET
NOUN
VERB
PUNCT

Thank you for taking a look at this ticket

Activity

  1. juditacs commented on Apr 2, 2018

    @juditacs
    Collaborator

    No system is perfect and the Viterbi you train on this data will produce some errors, especially on small datasets like this one.

    The tagset we showed you during class is a simplified one and in practice more fine-grained tagsets are used (such as the one in the training data):

  2. pcsiszar commented on Apr 2, 2018

    @pcsiszar
    Author
  3. juditacs commented on Apr 2, 2018

    @juditacs
    Collaborator

    That does sound suspicious, there might be a bug in my solution. I'll look into it tomorrow.

    Thank you for the notification.

  4. juditacs commented on Apr 2, 2018

    @juditacs
    Collaborator

    BTW your output is not actually DET and NOUN, right? What is you exact output for all of the sentences in the example?

  5. juditacs commented on Apr 2, 2018

    @juditacs
    Collaborator

    Ok, I think I found the error. I was using int16 and my count matrices overflew. This only affects the very last test.

    I will think of a solution to replace the tests. It might involve you (and the other early workers) having to copy-paste your current solutions into a new notebook.

  6. juditacs commented on Apr 3, 2018

    @juditacs
    Collaborator

    I corrected the test, uploaded the new version. Please let me know if you still experience problems with it.

  7. pcsiszar commented on Apr 4, 2018

    @pcsiszar
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions