Documentation
¶
Index ¶
- func ExtractAll(text string) ([]string, []string, error)
- func ExtractSentences(text string) ([]string, error)
- func GetExpression(cleanedWordArr []string) word2vec.Expr
- func GetSentiment(s string) string
- type KeyPhrase
- type ParaAndScore
- type SentAndScore
- type Word2Vec
- func (w2v *Word2Vec) CheckSimilarity(cleanedSourceWordArr, cleanedTargetWordArr []string) (float32, error)
- func (w2v *Word2Vec) MostSimilarParagraphs(paragraphArr1, paragraphArr2 []string) (map[string]*ParaAndScore, error)
- func (w2v *Word2Vec) MostSimilarSentences(sentenceArr1, sentenceArr2 []string) (map[string]*SentAndScore, error)
- func (w2v *Word2Vec) OverallSimilarity(doc1, doc2 string) (float32, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractAll ¶
Extract all paragraphs and sentences from raw document
func ExtractSentences ¶
Extract all sentences from raw document
func GetExpression ¶
turns a wordarray into word2vec expression
func GetSentiment ¶
Uses RAKE.Go to get the sentiment from text responses include: "positive", "neutral", or "negative"
Types ¶
type KeyPhrase ¶
type KeyPhrase struct { // govader parsed phrase or word Phrase string // govader score Score float64 }
Key Value pair of govader score with phrase
func GetKeyPhrases ¶
Parses out phrases along with their score using govader
type ParaAndScore ¶
type ParaAndScore struct { // The paragraph string Paragraph string // how similar it is to other paragraph Score float32 }
Structure containing plain sentence and similarity score
type SentAndScore ¶
type SentAndScore struct { // The sentence string Sentence string // how similar it is to other sentence Score float32 }
Structure containing plain sentence and similarity score
type Word2Vec ¶
Holds loaded Model
func (*Word2Vec) CheckSimilarity ¶
func (w2v *Word2Vec) CheckSimilarity(cleanedSourceWordArr, cleanedTargetWordArr []string) (float32, error)
checks the similarity between two cleaned word arrays
func (*Word2Vec) MostSimilarParagraphs ¶
func (w2v *Word2Vec) MostSimilarParagraphs(paragraphArr1, paragraphArr2 []string) (map[string]*ParaAndScore, error)
Compares two arrays of paragraph and returns a hash map of paragraph1 strings paired to paragraph2 string with a score similarity as well
func (*Word2Vec) MostSimilarSentences ¶
func (w2v *Word2Vec) MostSimilarSentences(sentenceArr1, sentenceArr2 []string) (map[string]*SentAndScore, error)
Compares two arrays of sentences and returns a hash map of sentence1 strings paired to sentence2 string with a score similarity as well