MCPcopy Create free account

hub / github.com/Moonshile/ChineseWordSegmentation / functions

Functions34 in github.com/Moonshile/ChineseWordSegmentation

↓ 4 callersMethodget
(self, theta)
wordseg/hashtree.py:85
↓ 3 callersMethodcount
(self, transactions)
wordseg/hashtree.py:82
↓ 2 callersFunctionentropyOfList
Given a list of some items, compute entropy of the list The entropy is sum of -p[i]*log(p[i]) for every unique element i in the list, and p[i
wordseg/probability.py:10
↓ 2 callersMethodfilterCandidates
Build a HashTree with candidates cand, then count support of these candidates to filter out all those that have support not lower tha
wordseg/freqitem.py:20
↓ 2 callersMethodgetNodes
(self, theta)
wordseg/hashtree.py:89
↓ 1 callersMethod__init__
(self, text)
wordseg/wordseg.py:34
↓ 1 callersMethodaddBag
Note that bag must be sorted
wordseg/hashtree.py:16
↓ 1 callersMethodcompute
Compute frequency and entropy of this word @param length length of the document for training to get words
wordseg/wordseg.py:52
↓ 1 callersMethodcomputeAggregation
Compute aggregation of this word @param words_dict frequency dict of all candidate words
wordseg/wordseg.py:61
↓ 1 callersFunctionfind_version
(*file_paths)
setup.py:18
↓ 1 callersMethodfreqOneSet
Generate frequent 1-item sets
wordseg/freqitem.py:29
↓ 1 callersMethodgenFreqItemSets
@return Frequent item sets with their frequency
wordseg/freqitem.py:56
↓ 1 callersMethodgenNextCand
Generate next candidates by dynamic programming Find range [i, j) such that items in this range have same prefix e.g., [1,2,3
wordseg/freqitem.py:39
↓ 1 callersFunctiongenSubparts
Partition a string into all possible two parts, e.g. given "abcd", generate [("a", "bcd"), ("ab", "cd"), ("abc", "d")] For string of leng
wordseg/sequence.py:32
↓ 1 callersMethodgenWords
Generate all candidate words with their frequency/entropy/aggregation informations @param doc the document used for words generation
wordseg/wordseg.py:107
↓ 1 callersMethodgetNodes
(self, theta)
wordseg/hashtree.py:52
↓ 1 callersFunctionindexOfSortedSuffix
Treat a suffix as an index where the suffix begins. Then sort these indexes by the suffixes.
wordseg/wordseg.py:17
↓ 1 callersFunctionread
(*parts)
setup.py:13
↓ 1 callersFunctionsameNodes
(nodes1, nodes2)
wordseg/hashtree.py:66
↓ 1 callersMethodsegSentence
Segment a sentence with the words generated from a document @param sentence the sentence to be handled @param method segmenta
wordseg/wordseg.py:133
↓ 1 callersMethodupdate
Increase frequency of this word, then append left/right neighbors @param left a single character on the left side of this word
wordseg/wordseg.py:42
Method__init__
(self, doc, max_word_len=5, min_freq=0.00005, min_entropy=2.0, min_aggregation=50)
wordseg/wordseg.py:87
Method__init__
(self, transactions, sup_theta=.1)
wordseg/freqitem.py:15
Method__init__
(self, name='')
wordseg/hashtree.py:10
Method__init__
(self, bags)
wordseg/hashtree.py:76
Method__str__
(self)
wordseg/hashtree.py:60
Method__str__
(self)
wordseg/hashtree.py:93
Methodcount
count the child who matches bag, suppose that current node matches
wordseg/hashtree.py:26
Functiondedup
deduplicate the given SORTED list
wordseg/sequence.py:8
FunctiongenSubstr
Generate all substrings of max length n for string
wordseg/sequence.py:21
Methodget
(self, theta)
wordseg/hashtree.py:41
FunctionlongestSubsequence
(s1, s2)
wordseg/sequence.py:58
FunctionlongestSubsequenceLength
(s1, s2)
wordseg/sequence.py:44
FunctionsameNode
(node1, node2)
wordseg/hashtree.py:63