Skip to content
Advertisement

Tag: nlp

Identify subject in sentences using spacy in advanced cases

I’m trying to identify the subject in a sentence. I tried to use some of the code here: This returns the results: the det python nsubjpass can aux be auxpass used ROOT to aux find xcomp objects dobj I would think in this case the python would be the subject, in most cases that would be the _dep would be

Finding words within paragraph using Python [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago. Improve this question Let say I have the following words, Test_wrds = [‘she’, ‘her’,’women’] that I would like to see whether any one

Build a dictionary from .txt files analysis

I have a basic program that can count the number of words in a given text file. I am trying to turn this into a program that can take in several different .txt files, with an arbitrary amount of keywords within those file analyzed, and output a dictionary within a list of the results (or similar object). The output I

Transformers v4.x: Convert slow tokenizer to fast tokenizer

I’m following the transformer’s pretrained model xlm-roberta-large-xnli example and I get the following error I’m using Transformers version ‘4.1.1’ Answer According to Transformers v4.0.0 release, sentencepiece was removed as a required dependency. This means that “The tokenizers that depend on the SentencePiece library will not be available with a standard transformers installation” including the XLMRobertaTokenizer. However, sentencepiece can be installed

Pytorch’s nn.TransformerEncoder “src_key_padding_mask” not functioning as expected

Im working with Pytorch’s nn.TransformerEncoder module. I got input samples with (as normal) the shape (batch-size, seq-len, emb-dim). All samples in one batch have been zero-padded to the size of the biggest sample in this batch. Therefore I want the attention of the all zero values to be ignored. The documentation says, to add an argument src_key_padding_mask to the forward

Model for measuring grammatical text quality [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago. Improve this question I generate text via transformer models and I am looking for a way of measuring the grammatical text-quality. Like the text:

Advertisement