MCPcopy Create free account

hub / github.com/cslu-nlp/DetectorMorse / functions

Functions18 in github.com/cslu-nlp/DetectorMorse

↓ 6 callersMethodsegments
Given a string of `text`, return a generator yielding each hypothesized sentence string
detectormorse/detector.py:209
↓ 3 callersMethodcandidates
Given a `text` string, get candidates and context for feature extraction and classification
detectormorse/detector.py:114
↓ 3 callersFunctionslurp
Given a `filename` string, slurp the whole file into a string
detectormorse/detector.py:68
↓ 2 callersMethodextract_one
Given left context `L`, punctuation mark `P`, and right context R`, extract features. Probability distributions for any quant
detectormorse/detector.py:141
↓ 2 callersMethodpredict
Given an left context `L`, punctuation mark `P`, and right context `R`, return True iff this observation is hypothesized to be a
detectormorse/detector.py:200
↓ 2 callersFunctionword_tokenize
Split string `text` into word tokens using the Penn Treebank rules
detectormorse/ptbtokenizer.py:74
↓ 1 callersFunctiondefault_model
Return a Detector loaded from the default model. Currently, the default model is trained on WSJ.
detectormorse/detector.py:89
↓ 1 callersMethodevaluate
Given a string of `text`, compute confusion matrix for the classification task.
detectormorse/detector.py:228
↓ 1 callersMethodfit
Given a string `text`, use it to train the segmentation classifier for `epochs` iterations.
detectormorse/detector.py:186
↓ 1 callersFunctionload_from_resource
Return a Detector loaded from resource with the specified name. The model name must match a filename existing under /models in this pack
detectormorse/detector.py:76
Method__init__
(self, text=None, nocase=NOCASE, epochs=EPOCHS, classifier=BinaryAveragedPerceptron, **kwargs
detectormorse/detector.py:100
Method__repr__
(self)
detectormorse/detector.py:107
Functiondefault_model
()
default_model_test.py:14
Functiontest_single_sentence
A single sentence is segmented as a single sentence.
default_model_test.py:18
Functiontest_strip
Strip non-initial whitespace by default.
default_model_test.py:39
Functiontest_strip_false
Preserve all whitespace when strip=False.
default_model_test.py:47
Functiontest_two_sentences_newline
Two sentences joined by newline are segmented as two sentences.
default_model_test.py:32
Functiontest_two_sentences_space
Two sentences joined by space are segmented as two sentences.
default_model_test.py:25