2 votes

Possible NLP approaches to extract 'goals' from text

Well, A quick approach to this is using named entity recognition and POS tagging to identify key phrases in the text that are likely to be goals. For example, you might look for phrases that contain ...
Vic's user avatar
  • 196
2 votes

Extract the embedding from a specific layer of MarianModel

You are passing discrete tokens as input to an attention layer that expects vectors of real numbers as inputs. The error you are getting tells you that the layer does not expect an input parameter ...
noe's user avatar
  • 20.5k
2 votes
Accepted

Creating class labels for custom DataSets efficiently (HuggingFace)

This is a coding style issue, so people may well have different opinions! But I don't see any problem with the way you've coded it. If you really want to reduce the number of lines of code you could ...
Lynn's user avatar
  • 1,088
2 votes
Accepted

What Preprocessing is Needed for Semantic Search Using Pre-trained Hugging Face Transformers?

Resumes are quite different from classic text because there are many proper nouns (names, companies, places, etc.) and other data difficult to classify (phone numbers, marks, age, etc.). That's why ...
Nicolas Martin's user avatar
2 votes
Accepted

How to get all 3 labels' sentiment from finbert instead of the most likely label's?

You can get the scores for all labels as follows: ...
Oxbowerce's user avatar
  • 6,902
2 votes
Accepted

What did Sentence-Bert return here?

There are two valid inputs to MPNet's tokenizer: Union[TextInputSequence, Tuple[InputSequence, InputSequence]] When you give a list of tuples as an input, from each tuple only the first two ...
Pushpam Punjabi's user avatar
2 votes

Dynamic batching and padding batches for NLP in deep learning libraries

That is commonly called sequence packing, creating a consistent-sized data structure composed of different, variable length sequences. Sequence packing has the potential to speed up training by ...
Brian Spiering's user avatar
1 vote

Dynamic batching and padding batches for NLP in deep learning libraries

Great questions! When training a model with batches of data with padded inputs, the padded tokens will take up GPU memory. This is because the padding zeros are still being stored in memory, even if ...
Pluviophile's user avatar
  • 3,360
1 vote

error useing soft max gives outputs greater than 1

This piece of Python code is what you described: import torch a = torch.tensor([[-3.7550,-4.4172,7.8079]]) b = torch.softmax(a, 1) print(b) print(torch.sum(b)) It ...
noe's user avatar
  • 20.5k
1 vote

Do I need training data in multiple languages for a multilingual transformer?

As far as I know, few multilingual models study their representation space to see if the representations of different languages occupy overlapping regions. The ones that do, usually find that the ...
noe's user avatar
  • 20.5k

Only top scored, non community-wiki answers of a minimum length are eligible