Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated approx_pos method in dataset.py #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hendrixjoseph
Copy link

Updated ParsedDictionaryDefinitionDataset approx_pos method in dataset.py.

Something must've changed in how a stanza.models.common.doc.Word is structured, causing the method def approx_pos(cls, nlp, sentence, lookup_idx, lookup_len): to fail.

The Word object now looks something like:

{
  "id": 6,
  "text": "a",
  "upos": "DET",
  "xpos": "DT",
  "feats": "Definite=Ind|PronType=Art",
  "start_char": 23,
  "end_char": 24
}

The plus side of this is that the start_char and end_char can now be extracted without using regex.

I've tested the change in Google Colab.

Updated ParsedDictionaryDefinitionDataset approx_pos method in dataset.py.

Something must've changed in how a `stanza.models.common.doc.Word` is structured, causing the method `def approx_pos(cls, nlp, sentence, lookup_idx, lookup_len):` to fail.

The Word object now looks something like:
```json
{
  "id": 6,
  "text": "a",
  "upos": "DET",
  "xpos": "DT",
  "feats": "Definite=Ind|PronType=Art",
  "start_char": 23,
  "end_char": 24
}
```

The plus side of this is that the `start_char` and `end_char` can now be extracted without using regex.

I've tested the change in Google Colab.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant