public class PMIHelper extends Object
Constructor and Description |
---|
PMIHelper(CachedNgramCounter ngrams) |
Modifier and Type | Method and Description |
---|---|
double |
getNPMI(String[] leftRight,
String[] left,
String[] right) |
double |
getNPMI(String leftRight,
String left,
String right) |
double |
getPMI(String[] leftRight,
String[] left,
String[] right)
Use this funtion to include variants into the same bucket.
|
double |
getPMI(String leftRight,
String left,
String right) |
static void |
main(String[] args) |
public PMIHelper(CachedNgramCounter ngrams)
public double getPMI(String[] leftRight, String[] left, String[] right)
For example, say you want to PMI for "hair of girl" and want to include {"hair", "the hair"} to get counts for the left part, and {"girl", "the girl", "a girl"} for the right and all combinations for leftRight, you need to call
String[] leftRight = {"hair of girl", "hair of the girl", ..., "the hair of girl",...};
String[] right = {"girl", "the girl", "a girl"};
String[] left = {"the hair", "hair"}
double pmi = getPMI(leftRight, left, right);
public static void main(String[] args)
Copyright © 2017. All rights reserved.