Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PMI to textstat_collocation? #14

Open
koheiw opened this issue Dec 16, 2018 · 1 comment
Open

Add PMI to textstat_collocation? #14

koheiw opened this issue Dec 16, 2018 · 1 comment
Assignees

Comments

@koheiw
Copy link
Collaborator

koheiw commented Dec 16, 2018

A post on SO brings me back to my old idea to add PMI to textstat_collocation(). It is less good as the lambda but super fast to run. PMI will be computed by

PMI = P("a b c") / (P("a") * P("b") * P("c"))

Where P("x") is a probability of "x" in the corpus.

@koheiw koheiw self-assigned this Dec 16, 2018
@kbenoit
Copy link
Contributor

kbenoit commented Dec 17, 2018

Yes we have that in https://github.com/kbenoit/quanteda.collocationsdev, where the idea is to use this for comparison in our paper (still under development) about collocations. We had this in but took it out while we prove that the log-linear approach is superior. Once we work that out (soon I hope!) we should definitely consider returning some of the other measures.

This is all standard stuff, e.g. https://nlp.stanford.edu/fsnlp/promo/colloc.pdf. However this does not for sizes > 2, since in the PMI example the marginal probabilities (in the denominator) need to account for P(a, b), P(b, c), P(a, c) as well. That's our angle with lambda.

Suggest we keep this separate as is and kick ourselves (myself) to flesh out the collocations paper, where we can sort all this out (with Jouni's input of course, as planned).

@kbenoit kbenoit transferred this issue from quanteda/quanteda Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants