A class for viewing Term-Frequency model.
Methods
__init__(corpus, model) | Initialize TfViewer. |
coll_freq(word) | Returns the frequency of word in all documents. |
coll_freqs([print_len, as_strings]) | Returns the frequency of all words in all documents. |
dismat_doc(doc_list[, dist_fn]) | Calculates a distance matrix for a given list of documents. |
dismat_word(word_list[, dist_fn]) | Calculates a distance matrix for a given list of words. |
dist_doc_doc(doc_or_docs[, weights, ...]) | Computes and sorts the distances between a document or list of documents and every document. |
dist_word_doc(word_or_words[, weights, ...]) | Computes and sorts distances between a word or a list of words to every document. |
dist_word_word(word_or_words[, weights, ...]) | Returns words sorted by the distances between word(s) and every word. |
Initialize TfViewer.
Parameters: |
|
---|
Returns the frequency of word in all documents.
Parameters: | word (string or integer) – Word to which its frequency is retrieved. |
---|---|
Returns: | freqency as integer |
Returns the frequency of all words in all documents.
Parameters: |
|
---|---|
Returns: | an instance of LabeledColumn. A table with words and their frequencies. |
Calculates a distance matrix for a given list of documents.
Parameters: |
|
---|---|
Returns: | an instance of IndexedSymmArray. n x n matrix containing floats where n is the number of documents in doc_list. |
See Also: | vsm.viewer.wrappers.dismat_doc() |
Calculates a distance matrix for a given list of words.
Parameters: |
|
---|---|
Returns: | an instance of IndexedSymmArray. n x n matrix containing floats where n is the number of words in word_list. |
See Also: | vsm.viewer.wrappers.dismat_word() |
Computes and sorts the distances between a document or list of documents and every document.
Parameters: |
|
---|---|
Returns: | an instance of LabeledColumn. A 2-dim array containing documents and their distances to doc_or_docs. |
See Also: | vsm.viewer.wrappers.dist_doc_doc() |
Computes and sorts distances between a word or a list of words to every document.
Parameters: |
|
---|---|
Returns: | an instance of LabeledColumn. A 2-dim array containing documents and their distances to word_or_words. |
See Also: | vsm.viewer.wrappers.dist_word_doc() |
Returns words sorted by the distances between word(s) and every word.
Parameters: |
|
---|---|
Returns: | an instance of LabeledColumn. A 2-dim array containing words and their distances to word_or_words. |
See Also: | vsm.viewer.wrappers.dist_word_word() |