Questions tagged [python]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
7
votes
1answer
402 views

Representing knowledge extracted from output of dependency parsing

I am working on a problem to represent knowledge extracted from a paragraph and rank it to produce abstractive summaries. I have implemented dependency parsing using Stanford NLP, which gives dot ...
6
votes
1answer
165 views

How to make a Corpus? (selecting a good structure)

I'm making a Corpus. I have searched for good practices on how to build it. I've downloaded some Corpus to check their internal structure and the extension file, but I didn't find many. So, I am lost ...
3
votes
0answers
108 views

n-gram language model smoothing [closed]

I use the corpora of webtext to train n-gram model in NLTK.And i use katz back-off smoothing to solve 0 count-problem.But one problem is:while the smoothing used in based-on characters language model,...
2
votes
1answer
319 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 ...
1
vote
2answers
798 views

Libs or APIs for removing background noise from voice input?

The effect of background noise on speech recognition is not good. Are there libs or APIs for removing background noise from voice input? Ideally language-agnostic or tuned for the top 100+ languages,...
1
vote
1answer
37 views

Python's treetaggerwrapper does not recognize numbers

I'm using treetaggerwrapper to stem Italian texts and I'm interested in the final lemmas. As you can see, while other parts of speech are transformed correctly, all numbers are changed to @card@. Is ...
1
vote
2answers
181 views

How to extract specific data from a TextGrid file?

I'm new here. Just found that there is a linguistics community on stack exchange! I have a TextGrid file that has been output from a forced aligner, webMAUS and I mainly want to understand how to ...
1
vote
1answer
82 views

P2G Alignment Algorithm in Python (OS X)

I'm looking for a basic phoneme-grapheme alignment algorithm which can be called in Python from a machine running OS X. So far the only implementations I've been able to find are part of larger C++ ...
1
vote
1answer
101 views

Seq2seq translation model. ValueError: An operation has `None` for gradient

So I'm trying to build a seq2seq encoder-decoder network for a translation task. I've been stuck now for a while, I have no idea how to fix the error I'm getting and would appreciate any help. My code ...
1
vote
1answer
939 views

Python list to Parse tree

In Python, I have an input of list like following: [('S', ['NP', 'VP']), ('A', ['V', 'NP']), ('VP', ['V', 'NP']), ('NP', ['DET', 'NP']), ('N', "'mouse'"), ('NP', "'mouse'"), ('DET', "'the'"), ('V', "'...
1
vote
1answer
123 views

Automated wh movement for turning an answer into the form of a question

I am not a linguist but I want to know if there are any parsing tools in existence that can help me do the following kind of thing: Given a sentence like the one below I would like to generate many ...
1
vote
0answers
54 views

How to apply TF-IDF on my bows after generating frequencies

I'm working on document similarity using WordNet, though I have no idea how to apply the IDF weighting at this point in my code. I'm sure this weighting is one of the most simple things out there, but ...
1
vote
0answers
664 views

Is there a Python lib to calculate HTER?

Is there a Python lib that calculates HTER - Human-targeted Translation Error Rate? Ideally it would expose a function that takes as parameters 1) at least one golden translation and 2) the ...
0
votes
1answer
104 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
111 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
0answers
1k views

ValueError: Can not squeeze dim[1], expected a dimension of 1

I want to buil a sequential LSTM model that predicts binary classification at every time step. More exactly, I want to predict an output for every paragraph in my texts (48 is the number of paragraphs)...
0
votes
1answer
2k views

Add-1 laplace smoothing for bigram implementation8

I am doing an exercise where I am determining the most likely corpus from a number of corpora when given a test sentence. I am trying to test an and-1 (laplace) smoothing model for this exercise. I ...
-3
votes
1answer
176 views

For each word in a corpus, find how many senses it has according to WordNet [closed]

I've come across this exercise in my studies and I do not know how to challenge, I've tried to follow examples though I can never find anything online that truly is symmetrical to what I'm trying to ...