Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [nltk]

for questions about the NLTK library used for computational linguistic programming

0
votes
1answer
25 views

Differences in Naive Bayes Classifier NLTK, same code, different answers?

I'm not sure what the difference between these 2 is: classifier = NaiveBayesClassifier.train(train_d) d1 = (nltk.classify.accuracy(classifier,train_d[:500]))*100 d2 = (nltk.classify.accuracy(...
0
votes
1answer
44 views

Jiang & Conrath when two words are the same

I would like to normalize the result of Jiang & Conrath similarity measure by dividing it by the maximum value(normally should be when both synsets are the same). I am using the implementation of ...
0
votes
0answers
37 views

How to write tag patterns to match noun phrases containing plural head nouns?

I'm trying to understand how to write tag patterns to make up a chunk grammar by writing a tag pattern that match noun phrases containing plural head nouns. For instance with "Many researchers came to ...
2
votes
1answer
29 views

Why are three tags necessary for the IOB format? What problem would be caused if we used I and O tags exclusively?

I'm trying to understand how representing chunks works by facing this question : The IOB format categorizes tagged tokens as I , O , and B . Why are three tags necessary? What problem would be ...
1
vote
1answer
38 views

What are the most relevant ways to store expressions in NLP?

I am trying to understand the best ways to store expressions for NLP from an exercise I received Consider the following two expressions, which have the same value. Which one will typically be ...
2
votes
1answer
97 views

How to tag_pos in nltk for a language that is not English?

Hi my country's language is not in nltk in python. I have a wordlist that contains word and part of speech (noun, verd adj etc.) in excel. But I don't know how to build a corpus. My language is not in ...
0
votes
1answer
294 views

Implementation of Jaccard Distance metric in nltk.metrics.distance not consistent with the mathematical definition?

I was trying to complete an NLP assignment using the Jaccard Distance metric function jaccard_distance() built into nltk.metrics.distance, when I noticed that the results from it did not make sense in ...
4
votes
2answers
97 views

Text classification of semantic relations within text

I am already familiar with some text (document) classification algorithms after processing into a Bag-of-words & tf-idf representation. Classification algorithms such as Multionmial Naive Bayes, ...
0
votes
1answer
79 views

How to extract rows with only meaningful text in a column

I have a large excel file like the following: Timestamp Text Work Id 5/4/16 17:52 rain a lot the packs maybe damage. Delivery XYZ 5/4/16 18:29 wh....
0
votes
1answer
143 views

How to determine who is the author of a message in the nps_chat corpora?

I try to use nps_chat corpora provided by nltk library. I follow the example given here. In particular, I can reproduce this results: >>> from nltk.corpus import nps_chat >>> ...
1
vote
1answer
360 views

GermaNLTK: not finding files [python]

Following the instructions of GermaNLTK I tried to install the german NLTK in Python. (I want to use the synsets for semantic-taging.) But I couldn't find the files germanet.py and GermanetDBBuilder....
3
votes
2answers
309 views

Why does Wordnet lack stopwords (“the”, “of”, “her”, etc)?

I have attempted to access it through both NLTK and the web inteface: http://wordnetweb.princeton.edu/perl/webwn?s=her&sub=Search%20WordNet&o2=&o0=1&o8=1&o1=1&o7=&o5=&...
3
votes
1answer
691 views

Detection if input sentence represents an incomplete sentence?

I am curious if there is an automated way to detect if a given string, representing a sentence, is an 'incomplete' sentence. By this I mean that either the text is not grammatically correct, or is ...
1
vote
0answers
312 views

How do PCFG parsers actually work?

I'm new to NLP. I have a few doubts about PCFG parser (NLTK). My understanding is that PCFG parser will return most probable parse tree. So if I'm parsing one sentence with PCFG parser, I'll be ...
2
votes
2answers
170 views

Determine adjective order algorithmically

Does NLTK (or any other Python natural language module) have the ability to determine the order of multiple modifier adjectives? For example: metal round huge bowl (incorrect) huge round metal bowl (...
5
votes
1answer
323 views

Semantic Relatedness metric across Parts of Speech

I am a student in psychology, but I have very little familiarity with linguistics. I am doing working on flexible cognition and memory, and we are developing a task that requires participants to ...
3
votes
2answers
520 views

How to search Penn TreeBank for arbitrary patterns?

What is a general way to parse the trees in the Penn TreeBank for arbitrary patterns, e.g. perhaps I want all trees which have a plural subject and whose sister VP has a modal verb daughter. ...
14
votes
1answer
8k views

What do WordNet::Similarity scores mean?

I am using WordNet Interface in NLTK, which facilitates computation of a number of similarity metrics: Path similarity Leacock-Chodorow Similarity Wu-Palmer Similarity Resnik Similarity Jiang-Conrath ...
1
vote
1answer
320 views

NLP conversion between parts of speech and pertainyms?

I would like to write a program that can automatically group e.g. 'happiness', 'happily', 'happy' into 'happy': What do I need to read to get a handle on this subject? What is it called? What is the ...
4
votes
1answer
3k views

Filling in incomplete sentences using NLP and Python

I am trying to leverage NLTK and Python to perform some sentence completion. The sentences I'm working with are incomplete and pretty much just read as garbage. An example sentence would be something ...
4
votes
2answers
1k views

Expressing Context Free Grammar from academic article with Python's NLTK

Please forgive the potentially noob question, but I'm trying to get started with semantic text analysis, particularly in the legal space. I found a very good paper which describes a context free ...