Questions tagged [python]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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 ...
2
votes
2answers
96 views

Finding phonetic similarity of names in different languages

I am trying to come up with a way using Python to find phonetic similarities between how differently written names with different meanings in different languages might sound alike. Names can be ...
2
votes
1answer
341 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 ...
7
votes
1answer
424 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 ...
1
vote
1answer
39 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
235 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 ...
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)...
1
vote
1answer
104 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 ...
6
votes
1answer
191 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
1answer
189 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 ...
1
vote
0answers
56 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 ...
0
votes
1answer
105 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(...
1
vote
2answers
826 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
958 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
87 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++ ...
0
votes
1answer
113 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....
3
votes
0answers
109 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,...
1
vote
1answer
126 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
685 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 ...