C# Класс Phamhilator.NLP.BagOfWords

Показать файл Открыть проект

Открытые методы

Метод Описание
AddDocument ( uint documentID, ushort>.IDictionary termTFs ) : void
BagOfWords ( ) : System
BagOfWords ( Term>.IDictionary terms ) : System
BagOfWords ( IEnumerable terms ) : System
ContainsDocument ( uint docID ) : bool
GetSimilarity ( IEnumerable terms, ushort maxDocsToReturn ) : float>.Dictionary

Calculates the cosine similarity of the given strings (normally words) compared to the current collection of Terms.

RecalculateIDFs ( ) : void
RemoveDocument ( uint documentID, ushort>.IDictionary termTFs ) : void

Приватные методы

Метод Описание
CalculateDocumentLength ( uint docID, List terms ) : float
CalculateQueryLength ( float>.Dictionary queryVector ) : float
CalculateQueryTfIdfVector ( IEnumerable terms ) : float>.Dictionary
GetDocument ( uint docID ) : List

Описание методов

AddDocument() публичный Метод

public AddDocument ( uint documentID, ushort>.IDictionary termTFs ) : void
documentID uint
termTFs ushort>.IDictionary
Результат void

BagOfWords() публичный Метод

public BagOfWords ( ) : System
Результат System

BagOfWords() публичный Метод

public BagOfWords ( Term>.IDictionary terms ) : System
terms Term>.IDictionary
Результат System

BagOfWords() публичный Метод

public BagOfWords ( IEnumerable terms ) : System
terms IEnumerable
Результат System

ContainsDocument() публичный Метод

public ContainsDocument ( uint docID ) : bool
docID uint
Результат bool

GetSimilarity() публичный Метод

Calculates the cosine similarity of the given strings (normally words) compared to the current collection of Terms.
public GetSimilarity ( IEnumerable terms, ushort maxDocsToReturn ) : float>.Dictionary
terms IEnumerable A collection of tokens (i.e., words) for a given string.
maxDocsToReturn ushort
Результат float>.Dictionary

RecalculateIDFs() публичный Метод

public RecalculateIDFs ( ) : void
Результат void

RemoveDocument() публичный Метод

public RemoveDocument ( uint documentID, ushort>.IDictionary termTFs ) : void
documentID uint
termTFs ushort>.IDictionary
Результат void