public class CoOccurrences extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
CoOccurrences.Builder |
class |
CoOccurrences.CoOccurrenceBatchIterator |
class |
CoOccurrences.CoOccurrenceIterator |
Modifier and Type | Field and Description |
---|---|
protected VocabCache |
cache |
protected InvertedIndex |
index |
protected boolean |
symmetric |
protected akka.actor.ActorSystem |
trainingSystem |
Constructor and Description |
---|
CoOccurrences(TokenizerFactory tokenizerFactory,
SentenceIterator sentenceIterator,
int windowSize,
VocabCache cache,
CounterMap<String,String> coOCurreneCounts,
boolean symmetric) |
Modifier and Type | Method and Description |
---|---|
Iterator<Pair<String,String>> |
coOccurrenceIterator()
Get an iterator over all possible non zero
co occurrences
|
Iterator<Pair<VocabWord,VocabWord>> |
coOccurrenceIteratorVocab() |
Iterator<List<Pair<VocabWord,VocabWord>>> |
coOccurrenceIteratorVocabBatch(int batchSize) |
List<Pair<String,String>> |
coOccurrenceList()
Return a list of all of the co occurrences
|
double |
count(String w1,
String w2) |
void |
fit() |
CounterMap<String,String> |
getCoOCurreneCounts() |
Counter<Integer> |
getSentenceOccurrences() |
static CoOccurrences |
load(InputStream from)
Load from an input stream with the following format:
w1 w2 score
|
int |
numCoOccurrences()
The number of co occurrences
|
List<Pair<String,String>> |
randomizedList()
Return a randomized list of the co occurrences
|
void |
setCoOCurreneCounts(CounterMap<String,String> coOCurreneCounts) |
void |
setSentenceOccurrences(Counter<Integer> sentenceOccurrences) |
protected transient VocabCache cache
protected InvertedIndex index
protected transient akka.actor.ActorSystem trainingSystem
protected boolean symmetric
public CoOccurrences(TokenizerFactory tokenizerFactory, SentenceIterator sentenceIterator, int windowSize, VocabCache cache, CounterMap<String,String> coOCurreneCounts, boolean symmetric)
public void fit()
public Iterator<List<Pair<VocabWord,VocabWord>>> coOccurrenceIteratorVocabBatch(int batchSize)
public static CoOccurrences load(InputStream from)
from
- the input stream to read frompublic List<Pair<String,String>> coOccurrenceList()
public List<Pair<String,String>> randomizedList()
public int numCoOccurrences()
public Iterator<Pair<String,String>> coOccurrenceIterator()
public CounterMap<String,String> getCoOCurreneCounts()
public void setCoOCurreneCounts(CounterMap<String,String> coOCurreneCounts)
Copyright © 2015. All rights reserved.