Adding vocab to field object
See original GitHub issueHi Everyone,
Is there any way of adding more vocabulary to a Field object that already has had its vocab built?
for example if at one point I have run this sort of code:
TEXT = field()
TEXT.build_vocab(dataset_a)
Is it possible to add vocab to TEXT from another dataset without erasing the current vocab built from dataset_a?
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Adding a field to a vocabulary | Drupal.org
You can do this with a free tagging vocabulary to group nodes by your calculated field values or just about anything.
Read more >torchtext.vocab - Read the Docs
Defines a vocabulary object that will be used to numericalize a field. Variables: freqs – A collections.Counter object holding the frequencies of tokens...
Read more >AttributeError: 'Field' object has no attribute 'vocab' preventing ...
im new in field of nlp so please help me fix this code, because it gives AttributeError: 'Field' object has no attribute 'vocab'...
Read more >Vocab · spaCy API Documentation
The Vocab object provides a lookup table that allows you to access Lexeme objects, as well as the StringStore . It also owns...
Read more >How to Create a Vocabulary for NLP Tasks in Python
Line by line, here's what the object variable initializations are doing ... How are we going to add words to the vocabulary?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Cool, thanks for the workflow. I’ll hopefully get around making this easier sometime soon.
Some challenges I am currently facing:
extend()
method ofVocab
which simply goes throughitos
of an argument and adds them to current vocab. I want to make it more general to acceptCounter
object as inVocab.__init__()
and also keep in mind originalmax_size
andmin_freq
arguments. But changing it this way may harm code that is using currententend()
methodspecials_first=False
it becomes unclear how to add new words, sincespecials
will no longer be at the end if itos/stoiVocab
with existingvectors
Any advice is highly appreciated!