question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for PTB and Universal POS tags

See original GitHub issue

Issue text updated by @goodmami

This issue appears to be a request to automatically map other part-of-speech tag schemes (such as PTB and Universal POS) to the ones used by wordnets so that a lookup for, e.g., wn.words('dog', pos='VERB') is equivalent to wn.words('dog', pos='v'). I’m not sure if the request is to also support reverse mappings (e.g., synset.ptb_pos).

Original issue text:

https://github.com/nltk/nltk/pull/2965

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
goodmamicommented, Apr 9, 2022

Ok, I think I understand. I’ve updated the original issue text to clarify (please update if it’s inaccurate).

However, my initial reaction is that this is not a good fit for Wn. Unlike the NLTK, Wn is not trying to accommodate a wide range of NLP tasks, but is specifically about modeling and working with wordnet data as defined by WN-LMF. I would therefore suggest using another tag mapper with Wn, such as the NLTK’s nltk.tag.mapping (but I’m not sure if it supports the wordnet tagset). If it does, you could write a wrapper function:

def ptb_synsets(lemma: str = None, pos: str = None, *args, **kwargs) -> wn.Synset:
  if pos:
    pos = map_tag('en-ptb', 'wordnet', pos)
  return wn.synsets(lemma, pos, *args, **kwargs)
0reactions
goodmamicommented, May 2, 2022

Since support for non-wordnet POS schemes is not currently part of the roadmap, so I will close this as wontfix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Allow `nltk.corpus.wordnet` to take in PTB and Universal tags
I think the issue arises when people are told that NLTK WordNet now supports Universal/PTB, as they might e.g. try to find synsets...
Read more >
Universal POS tags
These tags mark the core part-of-speech categories. To distinguish additional lexical and grammatical properties of words, use the universal features.
Read more >
How to reduce the number of POS tags in Penn Treebank?
If you ask it to map from en-ptb (the Penn Treebank PoS) to universal you will reduce the number of PoS tags.
Read more >
From POS tagging to dependency parsing for ... - NCBI
We have presented a detailed empirical study comparing traditional feature-based and neural network-based models for POS tagging and dependency parsing in the ...
Read more >
Penn Treebank P.O.S. Tags
Alphabetical list of part-of-speech tags used in the Penn Treebank Project: ; 17. POS, Possessive ending ; 18. PRP, Personal pronoun ; 19....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found