Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cbaziotis/ekphrasis
/ functions
Functions
82 in github.com/cbaziotis/ekphrasis
⨍
Functions
82
◇
Types & classes
8
↓ 14 callers
Method
wrap_non_matching
(exp)
ekphrasis/classes/tokenizer.py:228
↓ 9 callers
Method
known
The subset of `words` that appear in the dictionary of WORDS.
ekphrasis/classes/spellcorrect.py:63
↓ 8 callers
Method
segment
(self, word)
ekphrasis/classes/segmenter.py:133
↓ 6 callers
Method
edit_step
All edits that are one edit away from `word`.
ekphrasis/classes/spellcorrect.py:44
↓ 5 callers
Method
add_special_tag
(m, tag, mode="single")
ekphrasis/classes/preprocessor.py:112
↓ 3 callers
Method
case_of
Return the case-function appropriate for text: upper, lower, title, or just str.
ekphrasis/classes/spellcorrect.py:126
↓ 3 callers
Function
get_stats_dir
()
ekphrasis/utils/helpers.py:12
↓ 3 callers
Function
prune_low_freq
remove ngrams with count less than mincount avoid dict comprehension as it creates a new temp dict and overloads the memory Args:
ekphrasis/tools/generate_stats.py:150
↓ 3 callers
Function
read_stats
(corpus, ngram)
ekphrasis/utils/helpers.py:45
↓ 3 callers
Method
write
(self)
ekphrasis/dicts/sentiment/nrc_emolex/NRCEmolex.py:19
↓ 3 callers
Function
write_stats
(counts)
ekphrasis/tools/generate_stats.py:131
↓ 2 callers
Method
correct
Most probable spelling correction for word.
ekphrasis/classes/spellcorrect.py:98
↓ 2 callers
Function
count_file
Count the word statistics of a file :param desc: :param filename: :param countkeeper: :return:
ekphrasis/tools/generate_stats.py:106
↓ 2 callers
Method
edits2
All edits that are two edits away from `word`.
ekphrasis/classes/spellcorrect.py:56
↓ 2 callers
Method
get_compiled
(self)
ekphrasis/classes/exmanager.py:13
↓ 2 callers
Method
handle_generic_match
Args: m (): tag (): mode (): Returns:
ekphrasis/classes/preprocessor.py:200
↓ 2 callers
Method
pre_process_doc
(self, doc)
ekphrasis/classes/preprocessor.py:249
↓ 1 callers
Method
add_to_pipeline
(self, term)
ekphrasis/classes/tokenizer.py:51
↓ 1 callers
Method
best_elong_candidate
(self, word)
ekphrasis/classes/spellcorrect.py:148
↓ 1 callers
Method
build
(self, pipeline)
ekphrasis/classes/tokenizer.py:55
↓ 1 callers
Function
check_stats_files
()
ekphrasis/utils/helpers.py:88
↓ 1 callers
Method
combine
Combine first and rem results into one (probability, words) pair :param first: a tuple in the form: probability, word :param
ekphrasis/classes/segmenter.py:96
↓ 1 callers
Method
condProbWord
Conditional probability of word, given previous word if bigram is not in our list, then fall back to unigrams Args:
ekphrasis/classes/segmenter.py:69
↓ 1 callers
Method
correct_word
Spell-correct word in match, and preserve proper upper/lower/title case.
ekphrasis/classes/spellcorrect.py:118
↓ 1 callers
Method
dict_replace
(wordlist, _dict)
ekphrasis/classes/preprocessor.py:229
↓ 1 callers
Function
download_statistics
()
ekphrasis/utils/helpers.py:72
↓ 1 callers
Method
edit_candidates
Generate possible spelling corrections for word.
ekphrasis/classes/spellcorrect.py:73
↓ 1 callers
Method
elong_normalized_candidates
(self, word, acc=None)
ekphrasis/classes/spellcorrect.py:136
↓ 1 callers
Function
find_negations
Takes as input a list of words and returns the positions (indices) of the words that are in the context of a negation. :param list doc:
ekphrasis/utils/nlp.py:71
↓ 1 callers
Method
find_segment
Return (log P(words), words), where words is the best estimated segmentation :param text: the text to be segmented :param pre
ekphrasis/classes/segmenter.py:118
↓ 1 callers
Function
get_ngrams
(input_list, n)
ekphrasis/tools/generate_stats.py:81
↓ 1 callers
Method
handle_elongated_match
(self, m)
ekphrasis/classes/preprocessor.py:158
↓ 1 callers
Method
handle_emphasis_match
:param m: :return:
ekphrasis/classes/preprocessor.py:217
↓ 1 callers
Method
handle_hashtag_match
Break a string to its constituent words (using Viterbi algorithm)
ekphrasis/classes/preprocessor.py:130
↓ 1 callers
Method
handle_repeated_puncts
return the sorted set so mathes random combinations of puncts will be mapped to the same token "!??!?!!", "?!!!!?!", "!!?", "
ekphrasis/classes/preprocessor.py:182
↓ 1 callers
Function
listdir_nohidden
(path)
ekphrasis/utils/helpers.py:68
↓ 1 callers
Method
most_probable
(self, words)
ekphrasis/classes/spellcorrect.py:36
↓ 1 callers
Method
normalize_elongated
(self, word)
ekphrasis/classes/spellcorrect.py:153
↓ 1 callers
Function
parse_stats
Read key,value pairs from file.
ekphrasis/utils/helpers.py:28
↓ 1 callers
Function
polarity
Estimate the sentiment polarity of a tokenized document. Args: doc (): a list of words (strings) neg_comma (): if True, the n
ekphrasis/utils/nlp.py:175
↓ 1 callers
Method
pre_process_docs
(self, docs, lazy=True)
ekphrasis/classes/preprocessor.py:347
↓ 1 callers
Method
remove_hashtag_allcaps
(wordlist)
ekphrasis/classes/preprocessor.py:233
↓ 1 callers
Function
remove_tags
Remove tags from sentence
ekphrasis/utils/helpers.py:100
↓ 1 callers
Method
splits
Return a list of all possible (first, rem) pairs with max length of first <=L :param text: :return:
ekphrasis/classes/segmenter.py:107
↓ 1 callers
Function
tokenize
extract words from text :param text: :return:
ekphrasis/tools/generate_stats.py:69
↓ 1 callers
Function
unpack_contractions
Replace *English* contractions in ``text`` str with their unshortened forms. N.B. The "'d" and "'s" forms are ambiguous (had/would, is/has/po
ekphrasis/utils/nlp.py:24
↓ 1 callers
Method
verbose_text
(self, text, tokenized)
ekphrasis/classes/tokenizer.py:64
↓ 1 callers
Method
verbose_text
(self, text, tokenized)
ekphrasis/classes/tokenizer.py:231
↓ 1 callers
Method
wrap_non_matching
(exp)
ekphrasis/classes/tokenizer.py:61
↓ 1 callers
Function
write_stats_to_file
(file, counts, mincount)
ekphrasis/tools/generate_stats.py:85
Method
P
Probability of `word`.
ekphrasis/classes/spellcorrect.py:30
Method
__call__
(self, key)
ekphrasis/classes/segmenter.py:40
Method
__copy__
(self)
ekphrasis/classes/preprocessor.py:105
Method
__deepcopy__
(self, memo)
ekphrasis/classes/preprocessor.py:108
Method
__init__
(self)
ekphrasis/dicts/sentiment/nrc_emolex/NRCEmolex.py:14
Method
__init__
Kwargs: omit (list): choose what tokens that you want to omit from the text. possible values: ['email', 'percent'
ekphrasis/classes/preprocessor.py:14
Method
__init__
:param corpus: the statistics from which corpus to use for the spell correction.
ekphrasis/classes/spellcorrect.py:17
Method
__init__
Args: pipeline (list): list of terms to use for tokenization. Each term, is a key from the dict of regexes `expre
ekphrasis/classes/tokenizer.py:19
Method
__init__
Args: lowercase (bool): set to True in order to lowercase the text verbose (bool): set to True to print each text af
ekphrasis/classes/tokenizer.py:95
Method
__init__
(self, data=None, total=None, unk_func=None, **kwargs)
ekphrasis/classes/segmenter.py:29
Method
__init__
Args: corpus (str): the statistics from which corpus to use for the spell correction. max_split_lengt
ekphrasis/classes/segmenter.py:48
Function
check_empty_arg
(value)
ekphrasis/tools/generate_stats.py:25
Method
correct_match
Spell-correct word in match, and preserve proper upper/lower/title case.
ekphrasis/classes/spellcorrect.py:110
Method
correct_text
Correct all the words within a text, returning the corrected text.
ekphrasis/classes/spellcorrect.py:104
Method
default_unk_func
(key, total)
ekphrasis/classes/segmenter.py:26
Method
demo
(self)
ekphrasis/classes/segmenter.py:139
Function
doc_ngrams
(doc, n_from=1, n_to=2)
ekphrasis/utils/nlp.py:65
Function
mark_doc
Given a list of words and a set of word positions, mark the words in those positions. :param list doc: a list of words (strings) :param s
ekphrasis/utils/nlp.py:144
Function
parse_int_list
(value)
ekphrasis/tools/generate_stats.py:31
Function
plot_statistics
(statistics)
ekphrasis/tools/generate_stats.py:168
Method
print_expressions
(self)
ekphrasis/classes/exmanager.py:18
Function
print_positive
(sentiment)
ekphrasis/dicts/emoticons.py:210
Function
product
Return the product of a sequence of numbers.
ekphrasis/utils/helpers.py:94
Method
read
(self)
ekphrasis/dicts/sentiment/nrc_emolex/NRCEmolex.py:51
Function
read_slangdict
()
ekphrasis/dicts/noslang/manager.py:6
Method
similar
(a, b)
ekphrasis/classes/spellcorrect.py:70
Method
tokenize
(self, text)
ekphrasis/classes/tokenizer.py:74
Method
tokenize
(self, text)
ekphrasis/classes/tokenizer.py:241
Method
tokens
(text)
ekphrasis/classes/spellcorrect.py:27
Method
unk_probability
Estimate the probability of an unknown word, penalizing its length :param key: the word :param total: the count of all tokens
ekphrasis/classes/segmenter.py:86
Function
ws_tokenizer
(text)
ekphrasis/examples/example.py:6
Function
wsp_tokenizer
(text)
ekphrasis/examples/demo_tok.py:9