583 questions
0
votes
0
answers
169
views
Issues with nltk's ne_chunk
I have been trying to use nltk's entity chunker, and tried different approaches but I keep getting the error:
LookupError Traceback (most recent call last)
...
...
1
vote
1
answer
202
views
Custom spaCy tagger to tag all words that are in a dictionary
I'm trying spaCy to extract specific information from a text.
So I need to configure a custom tokenizer to identify them and a custom tagger to label all the words that are in an external dictionary ...
0
votes
1
answer
665
views
Unable to load a model from hugging face
Was using this POS tagging model few moths ago with no issues.
Recently tried again , but the model is not loading.
Please help!!!!!!!
Tried to load the model, but diplaying the same error.
Tried with ...
1
vote
1
answer
383
views
How can I enhance morphological information for English models in spaCy?
I am trying to detect verbs that are in the imperative mood using English models in spaCy but I am seeing morphological features that are inconsistent with the examples found in the Morphology ...
0
votes
1
answer
135
views
Return list of sentences with a particular subject
I am exploring a small corpus of texts, and one of the things I am doing is examining the actions associated with various subjects. I have already inventoried how many times, for example, "man&...
1
vote
1
answer
134
views
how to apply nltk.pos_tag() for ngrams
I need to use nltk.pos_tag() together with bigrams and here's my code:
from nltk.util import ngrams
from collections import Counter
bigrams = list(ngrams(all_file_data, 2))
print(bigrams[:50])
print(...
0
votes
1
answer
121
views
How to get pos-tag lemmatiser to iterate through df
I want to use POS-labelling and lemmatisation on my text data. I've found this example code from kaggle. This applies it to a sentence, but I want to modify this code in order to apply it to a column ...
0
votes
1
answer
242
views
Apply POS tag to nested list
I'm trying to go through multiple sentences in a text. Each sentence is stored in nested list structure (i.e. a list of each sentence in the form of a list). I then want to apply POS tag to each '...
1
vote
0
answers
113
views
How to lemmatize pos tagged column in dataframe
I have a Dataframe of some tweets about the Russia-Ukraine conflict and I have pos_tagged the tweets after cleaning and want to lemmatize postagged column. My code returns only the first pos_tagged ...
0
votes
1
answer
321
views
how to get only the nouns from a sentence
I'm trying to find out which nouns exist in a sentence, i'm using pos_tag from nltk but it's not working very well
here is my code/function
def Noun(sentence):
lista=[]
words=(word_tokenize(...
1
vote
1
answer
639
views
How to extract phrases from text using specific noun-verb-noun NLTK PoS tag patterns?
I have a data frame that has a column containing some text.
I want to extract phrases from the text with the format NN + VB + NN or NN + NN + VB + NN or NN + ... + NN + VB + NN et cetera. Basically, I ...
2
votes
1
answer
1k
views
Lemmatizer/PoS-tagger for italian in Python
I'm searching for a Lemmatizer/PoS-tagger for the Italian language, that works on Python. I tried with Spacy, it works but it's not very precise, expecially for verbs it often returns the wrong lemma. ...
0
votes
1
answer
63
views
Reverse from POS tagging to sentence using pandas
I have pos_token dataset and I want to transform them to be a sentence again using pandas
pos_token
sentence
[(No, DT), (you, PRP), (lying, VBG)]
No you lying
1
vote
1
answer
84
views
Remove item from list of tuple with two elements across rows
I have a set of >1000 rows of POS-tagged sentences. I want to remove words that are tagged with "RB", "IN", "PRP", "CC", "PR", "DT", &...
1
vote
1
answer
898
views
Retrieve a list of model-specific POS tags using spaCy
I am looking for a way to get a list of all possibly usable POS tags for a specific language model in spaCy.
In an answer to another question, spaCy's TAG_MAP has been referenced to, but I am not sure ...
-1
votes
1
answer
180
views
New to NLP help needed with using spacy to get POS
I have a list below. I want to get the corresponding POS against each token. I have given a sample output below
processed_lst = [['The', 'wild', 'is', 'dangerous'], ['The', 'rockstar', 'is', 'wild']]
...
2
votes
3
answers
5k
views
Company name extraction with bert-base-ner: easy way to know which words relate to which? [closed]
Hi I'm trying to extract the full company name from a string description about the company with bert-base-ner. I am also open to trying other methods but I couldn't really find one. The issue is that ...
1
vote
1
answer
635
views
No POS tags in newly trained spaCy NER model, how to enable?
I trained a NER model following the spaCy Training Quickstart and only enabled the ner pipeline for training since it is the only data I have.
Here is the partial config
[nlp]
lang = "en"
...
0
votes
1
answer
143
views
Why does Stanford NER tagger give different tags for similar lists?
I would like to understand better why the Stanford NER (Name Entity Recognition) tagger yields different results for the same words, depending on the list of words you submit to it.
Here is an example:...
0
votes
2
answers
619
views
How to filter a sentence based on list of the allowed words in python?
I have allow_wd as words that I want to search.
The sentench is an array of the main database.
The output need:
Newsentench = ['one three','']
Please help
sentench=['one from twooo or three ...
0
votes
1
answer
684
views
Python function return the same value for each row
i want to pos-tagging a dataset of .csv file. I create a function which i hope can return the value of the pos-tagged words. But the value that return , instead give a value of the row , it return all ...
0
votes
0
answers
102
views
How can I count entities by their label for precision and recall
I have some data which are like this:
True Predicted
A M M
Pizza B-Food B-Food
with I-Food I-Food
Peppers I-Food I-Food [...
2
votes
1
answer
234
views
Matching patterns in spaCy returns a empty result
I was hoping to find some patterns with this simple code. But the result is empty.
I'm forgetting something?
for tk in doc[:30]:
print (tk.text, ':', tk.pos_)
Método : NOUN
de : ADP
...
0
votes
0
answers
224
views
Text classification using POS taggers of spacy
I'm very new to NLP and new to spacy as well and trying to learn things by myself.
My question is, is there a way to classify if a text is sarcastic or if it's a warning or an order, using spacy's pos ...
0
votes
1
answer
23
views
Removing 1 NN in a sentence NLTK
I want to remove 1 NN in my sentence but my in my code all NN are gone. I just want to remove 1 NN in a sentence thankyou :)
text = ' Computes frequency count and fraction of individual words in a ...
0
votes
1
answer
880
views
Split text into tokens on different rows in a dataframe
I am new to this but I am trying to split text in a pandas dataframe into individual rows consisting of each tokens of the text and also its respective POS and TAG. For example:
Text
1 ...
2
votes
0
answers
831
views
Is it possible to to add a part of speech tag to a spaCy tokenizer special case?
I have a list of compounds and other special cases that I want spaCy to recognise as tokens, such as 'according to' and 'washing machine'. I used 'add_special_case' to do this:
import spacy
...
1
vote
1
answer
135
views
Position of that Noun and Verb
I have a rule-based code that prints out the Noun which is followed by a verb in a sentence
for text_id, text in enumerate(news_df['news_title'].values):
# Remove the comma and full stops
...
6
votes
2
answers
2k
views
Finding the position of Noun and Verb in a sentence Python
Is there a way to find the position of the words with pos-tag 'NN' and 'VB' in a sentence in Python?
example of a sentences in a csv file:
"Man walks into a bar."
"Cop shoots his gun.&...
5
votes
0
answers
1k
views
How to disable seqeval label formatting for POS-tagging
I am trying to evaluate my POS-tagger using huggingface's implementation of the seqeval metric but, since my tags are not made for NER, they are not formatted the way the library expects them. ...
1
vote
0
answers
114
views
POS Tagger for declension of german words in Java
The RFTagger is a Part-Of-Speech Tagger with very detailed tags for german words.
According to their website, output looks like this:
word
part of speech
Das
PRO.Dem.Subst.-3.Nom.Sg.Neut
ist
VFIN.Sein....
0
votes
0
answers
208
views
Split the string into multiple sentences with R and pos tagging
I don't know if this is the right place, but if possible, could you help me split a text into several sentences using R.
I have a database that contains the description of activities that employees ...
0
votes
1
answer
442
views
Unable to create a custom torchtext BucketIterator
I'm trying to create a POS tagger with LSTM and I'm facing some difficulties with preparing the data.
I've successfully followed a guide that used the following code to prepare the data itertors:
TEXT ...
1
vote
1
answer
213
views
Identifying People, Places, and Organizations in Japanese with NLTagger
I am trying to use the natural language tagger for Japanese. I used this sample code:
"https://developer.apple.com/documentation/naturallanguage/identifying_people_places_and_organizations"
...
1
vote
2
answers
636
views
Search for particular parts of speech (e.g. nouns) and print them along with a preceding word
I have a text which is made up of a list of basic sentences, such as "she is a doctor", "he is a good person", and so forth. I'm trying to write a program which will return only ...
0
votes
1
answer
760
views
Text classification using Word2Vec and Pos tag
I have a medical dataset like
Text: "weakness, diarrhea, neck pain" Target:"X.1, Y.1" which is coded diagnosis
Also I am using pre-trained Word2Vec and pos tagging.
For example the ...
1
vote
1
answer
340
views
Why does Viterbi algorithm (POS tagging) always predict one tag?
Here is my HMM model class:
class HiddenMarkovModel:
def __init__(self):
pass
def fit(self, train_tokens_tags_list):
"""
...
1
vote
1
answer
394
views
No pos tags by Spacy's multilingual xx_ent_wiki_sm
I am using Spacy's multilingual pos-tagger -- xx_ent_wiki_sm. The problem is it doesn't return any pos tags. If you have encountered the same issue, please, share your ideas/solution. Thank you!
Code ...
1
vote
1
answer
974
views
Building a tagger with spacy 3
I want to add more words to the SpaCy model in portuguese so that I can use the PoS (part of speech) of a specific domain, but I don't want to add isolated words but sentences. I did these three steps:...
-2
votes
1
answer
268
views
Get a tag list from pos tagging
Currently, I am working on an NLP project, and after applying pos tagging, I have received the below output.
[[(ද්විපාර්ශවික, NNP), (එකඟතා, NNP), (ජන, JJ), (ජීවිත, NNJ), (සෞඛ්යය, NNC), (මනාව, RB)]]
...
0
votes
2
answers
1k
views
Improve text classification accuracy by using POS tagging - NLP
I am doing a project which category a tweet into Health and politics categories. I used the Naive Bayes algorithm for classification.
I am trying to improve the accuracy of the Naive Bayes ...
0
votes
1
answer
391
views
count the occurrences of POS tagging pattern
So I've applied POS tagging to one of the columns in my dataframe. For each sentence, I want to count the occurrences of this pattern: NNP, MD, VB.
For example, I have the following sentence:
...
0
votes
1
answer
84
views
Regex NLTK chunking - Can't get my regex rule to identify certain pos tags
Hi I am attempting to identify very specific sentence structures but the rule i am writing in regex seems to skip occasional parts of my test samples. Here is an example:
chunkRule= r"""...
0
votes
1
answer
270
views
Building own classifier based POS tagger using NLTK's SklearnClassifier and ClassifierBasedPOSTagger
I'm trying to build my own classifier based POS tagger using SklearnClassifier and ClassifierBasedPOSTagger. The code that I've tried is given below.
from nltk.corpus import treebank
nltk.download('...
3
votes
1
answer
803
views
Google Translate Part of Speech
I'm set up with RESTFul Google Cloud Translate on my NodeJS server.
Their Google Translate Web Client offers a ton of useful translation metadata, including Part of Speech (See noun in lower right):
...
0
votes
1
answer
2k
views
How to tag unknown words (Tokens with tag UNK) in combined taggers
I am using the combined tagger described in the nltk book - chapter 5
Here is the code
t0 = nltk.DefaultTagger('NN')
t1 = nltk.UnigramTagger(train_sents, backoff=t0)
t2 = nltk.BigramTagger(...
0
votes
1
answer
1k
views
Extracting abstract nouns and adjectives from a string in Python [duplicate]
I am working on a data frame that has one of the columns containing feedback text. It has been cleaned.
All I need to know is how to extract the abstract nouns and adjectives from the string.
Here's a ...
0
votes
1
answer
34
views
How to get consolidated words post tagging?
I am working on a dataset that requires extracting all the words that are adjectives, verbs, and adverbs from each sentence of a data frame column.
This is a sample I was working on to figure out how ...
1
vote
1
answer
130
views
How to fix this code and make my own POS-tagger? (PYTHON)
My program need to read a file with sentences and produce an output like that:
input: Ixé Maria.
output: Ixé\PRON Maria\N-PR.
Until now, I wrote this, but the outfile gives me an empty textfile. (...
0
votes
1
answer
22
views
Problem to print list of tuple for every sentence seperately
If we have situation like that
[(ali,noun),(ahmad, noun),(play , verb)], [(read, verb), (is, helping verb), (waqar, noun)]
I want to print only verb from these list of tuple but when i print it will ...