nltk API reference
400 public APIs from nltk (nltk/nltk) — 223 classes, 45 functions, 132 methods. Signatures extracted by static analysis of the actual source.
Repository: nltk/nltk
| Kind | Count |
|---|---|
| Classes | 223 |
| Functions | 45 |
| Methods | 132 |
API list
class
nltk.app.chartparser_app.ChartViewA component for viewing charts.
method
nltk.app.chartparser_app.ChartView.draw()Draw everything (from scratch).
method
nltk.app.chartparser_app.ChartView.mark_edge(edge, mark='#0df')Mark an edge
method
nltk.app.chartparser_app.ChartView.unmark_edge(edge=None)Unmark an edge (or all edges)
class
nltk.app.rdparser_app.RecursiveDescentAppA graphical tool for exploring the recursive descent parser.
method
nltk.app.rdparser_app.RecursiveDescentApp.mainloop(*args, **kwargs)Enter the Tkinter mainloop.
class
nltk.app.srparser_app.ShiftReduceAppA graphical tool for exploring the shift-reduce parser.
method
nltk.app.srparser_app.ShiftReduceApp.mainloop(*args, **kwargs)Enter the Tkinter mainloop.
class
nltk.app.wordnet_app.ReferenceA reference to a page that may be generated by page_word
func
nltk.app.wordnet_app.get_static_index_page(with_shutdown)Get the static index page.
func
nltk.app.wordnet_app.get_static_web_help_page()Return the static web help page.
func
nltk.app.wordnet_app.get_static_welcome_message()Get the static welcome page.
func
nltk.app.wordnet_app.page_from_word(word)Return a HTML page for the given word.
func
nltk.app.wordnet_app.usage()Display the command line help message.
func
nltk.app.wordnet_app.wnb(port=8000, runBrowser=True, logfilename=None)Run NLTK Wordnet Browser Server.
class
nltk.ccg.api.AbstractCCGCategoryInterface for categories in combinatory grammars.
method
nltk.ccg.api.AbstractCCGCategory.is_primitive()Returns true if the category is primitive.
method
nltk.ccg.api.AbstractCCGCategory.is_var()Returns true if the category is a variable.
class
nltk.ccg.api.CCGVarClass representing a variable CCG category.
class
nltk.ccg.api.DirectionClass representing the direction of a function application.
method
nltk.ccg.api.Direction.restrs()A list of restrictions on the combinators.
class
nltk.ccg.api.FunctionalCategoryClass that represents a function application category.
class
nltk.ccg.api.PrimitiveCategoryClass representing primitive categories.
class
nltk.ccg.chart.BackwardTypeRaiseRuleClass for applying backward type raising.
class
nltk.ccg.chart.CCGChartParserChart parser for CCGs.
class
nltk.ccg.chart.CCGLeafEdgeClass representing leaf edges in a CCG derivation.
class
nltk.ccg.chart.ForwardTypeRaiseRuleClass for applying forward type raising
class
nltk.ccg.combinator.BackwardCombinatorThe backward equivalent of the ForwardCombinator class.
class
nltk.ccg.combinator.DirectedBinaryCombinatorWrapper for the undirected binary combinator.
class
nltk.ccg.combinator.UndirectedBinaryCombinatorAbstract class for representing a binary combinator.
class
nltk.ccg.combinator.UndirectedCompositionFunctional composition (harmonic) combinator.
class
nltk.ccg.combinator.UndirectedFunctionApplicationClass representing function application.
class
nltk.ccg.combinator.UndirectedSubstitutionSubstitution (permutation) combinator.
class
nltk.ccg.combinator.UndirectedTypeRaiseUndirected combinator for type raising.
class
nltk.ccg.lexicon.CCGLexiconClass representing a lexicon for CCG grammars.
method
nltk.ccg.lexicon.CCGLexicon.start()Return the target category for the parser
class
nltk.ccg.lexicon.TokenClass representing a token.
func
nltk.ccg.lexicon.parseApplication(app)Parse an application operator
method
nltk.chat.util.Chat.respond(str)Generate a response to the user input.
class
nltk.chunk.named_entity.Maxent_NE_ChunkerExpected input: list of pos-tagged words
class
nltk.chunk.named_entity.NEChunkParserExpected input: list of pos-tagged words
method
nltk.chunk.named_entity.NEChunkParser.parse(tokens)Each token should be a pos-tagged word
class
nltk.chunk.named_entity.NEChunkParserTaggerThe IOB tagger used by the chunk parser.
class
nltk.chunk.regexp.ChunkStringA string-based encoding of a particular chunking of a text.
class
nltk.chunk.regexp.RegexpChunkParserA regular expression based chunk parser.
class
nltk.chunk.regexp.RegexpParserA grammar based chunk parser.
class
nltk.chunk.util.ChunkScoreA utility class for scoring chunk parsers.
class
nltk.classify.naivebayes.NaiveBayesClassifierA Naive Bayes classifier.
class
nltk.classify.scikitlearn.SklearnClassifierWrapper for scikit-learn classifiers.
method
nltk.classify.scikitlearn.SklearnClassifier.classify_many(featuresets)Classify a batch of samples.
class
nltk.cluster.api.ClusterIInterface covering basic clustering functionality.
method
nltk.cluster.api.ClusterI.cluster_names()Returns the names of the clusters.
method
nltk.cluster.api.ClusterI.num_clusters()Returns the number of clusters.
class
nltk.cluster.util.DendrogramRepresents a dendrogram, a tree with a specified branching order.
class
nltk.collections.LazyConcatenationA lazy sequence formed by concatenating a list of lists.
class
nltk.collections.LazySubsequenceA subsequence produced by slicing a lazy sequence.
class
nltk.collections.TrieA Trie implementation for strings
class
nltk.corpus.reader.aligned.AlignedCorpusReaderReader for corpora of word-aligned sentences.
class
nltk.corpus.reader.aligned.AlignedSentCorpusViewA specialized corpus view for aligned sentences.
class
nltk.corpus.reader.bracket_parse.AlpinoCorpusReaderReader for the Alpino Dutch Treebank.
class
nltk.corpus.reader.chasen.ChasenCorpusViewA specialized corpus view for ChasenReader.
method
nltk.corpus.reader.chasen.ChasenCorpusView.read_block(stream)Reads one paragraph at a time.
class
nltk.corpus.reader.childes.CHILDESCorpusReaderCorpus reader for the XML version of the CHILDES corpus.
class
nltk.corpus.reader.chunked.ChunkedCorpusReaderReader for chunked (and optionally tagged) corpora.
class
nltk.corpus.reader.conll.ConllCorpusReaderA corpus reader for CoNLL-style files.
class
nltk.corpus.reader.conll.ConllSRLInstanceListSet of instances for a single sentence
class
nltk.corpus.reader.framenet.FramenetCorpusReaderA corpus reader for the Framenet Corpus.
method
nltk.corpus.reader.framenet.FramenetCorpusReader.fes(name=None, frame=None)Lists frame element objects.
method
nltk.corpus.reader.framenet.FramenetCorpusReader.frames(name=None)Obtain details for a specific frame.
method
nltk.corpus.reader.framenet.FramenetCorpusReader.semtypes()Obtain a list of semantic types.
class
nltk.corpus.reader.framenet.FramenetErrorAn exception class for framenet-related errors.
class
nltk.corpus.reader.framenet.PrettyDictDisplays an abbreviated repr of values where possible.
class
nltk.corpus.reader.ieer.IEERDocumentA class to represent a single document from the IEER corpus.
class
nltk.corpus.reader.indian.IndianCorpusReaderList of words, one per line.
class
nltk.corpus.reader.mte.MTECorpusViewClass for lazy viewing the MTE Corpus.
class
nltk.corpus.reader.mte.MTEFileReaderClass for loading the content of the multext-east corpus.
class
nltk.corpus.reader.nombank.NombankTreePointerwordnum:height*wordnum:height*...
class
nltk.corpus.reader.opinion_lexicon.OpinionLexiconCorpusReaderReader for Liu and Hu opinion lexicon.
class
nltk.corpus.reader.panlex_lite.MeaningRepresents a single PanLex meaning.
method
nltk.corpus.reader.panlex_lite.Meaning.id():return: the meaning's id.
method
nltk.corpus.reader.panlex_lite.Meaning.source():return: the meaning's source id.
class
nltk.corpus.reader.plaintext.PlaintextCorpusReaderReader for corpora that consist of plaintext documents.
class
nltk.corpus.reader.ppattach.PPAttachmentCorpusReadersentence_id verb noun1 preposition noun2 attachment
class
nltk.corpus.reader.propbank.PropbankTreePointerwordnum:height*wordnum:height*...
class
nltk.corpus.reader.pros_cons.ProsConsCorpusReaderReader for the Pros and Cons sentence dataset.
class
nltk.corpus.reader.reviews.ReviewA Review is the main block of a ReviewsCorpusReader.
method
nltk.corpus.reader.reviews.Review.features()Return a list of features in the review.
class
nltk.corpus.reader.rte.RTECorpusReaderCorpus reader for corpora in RTE challenges.
class
nltk.corpus.reader.rte.RTEPairContainer for RTE text-hypothesis pairs.
class
nltk.corpus.reader.semcor.SemcorCorpusReaderCorpus reader for the SemCor Corpus.
class
nltk.corpus.reader.sinica_treebank.SinicaTreebankCorpusReaderReader for the sinica treebank.
class
nltk.corpus.reader.tagged.MacMorphoCorpusReaderA corpus reader for the MAC_MORPHO corpus.
class
nltk.corpus.reader.tagged.TaggedCorpusReaderReader for simple part-of-speech tagged corpora.
class
nltk.corpus.reader.tagged.TaggedCorpusViewA specialized corpus view for tagged documents.
method
nltk.corpus.reader.tagged.TaggedCorpusView.read_block(stream)Reads one paragraph at a time.
class
nltk.corpus.reader.verbnet.VerbnetCorpusReaderAn NLTK interface to the VerbNet verb lexicon.
class
nltk.corpus.reader.wordlist.WordListCorpusReaderList of words, one per line.
class
nltk.corpus.reader.wordnet.WordNetCorpusReaderA corpus reader used to access wordnet or its variants.
method
nltk.corpus.reader.wordnet.WordNetCorpusReader.of2ss(of)take an id and return the synsets
method
nltk.corpus.reader.wordnet.WordNetCorpusReader.ss2of(ss)return the ID of the synset
class
nltk.corpus.reader.wordnet.WordNetErrorAn exception class for wordnet-related errors.
class
nltk.corpus.reader.xmldocs.XMLCorpusReaderCorpus reader for corpora whose documents are xml files.
func
nltk.data.clear_cache()Remove all objects from the resource cache.
func
nltk.decorators.getattr_(obj, name, default_thunk)Similar to .setdefault in dictionaries.
func
nltk.decorators.update_wrapper(wrapper, model, infodict=None)akin to functools.update_wrapper
class
nltk.downloader.CollectionA directory entry for a collection of downloadable packages.
class
nltk.downloader.DownloaderMessageA status message object, used by ``incr_download`` to communicate its progress.
class
nltk.downloader.ErrorMessageData server encountered an error
class
nltk.downloader.FinishCollectionMessageData server has finished working on a collection of packages.
class
nltk.downloader.FinishDownloadMessageData server has finished downloading a package.
class
nltk.downloader.FinishPackageMessageData server has finished working on a package.
class
nltk.downloader.FinishUnzipMessageData server has finished unzipping a package.
class
nltk.downloader.PackageA directory entry for a downloadable package.
class
nltk.downloader.ProgressMessageIndicates how much progress the data server has made
class
nltk.downloader.SelectDownloadDirMessageIndicates what download directory the data server is using
class
nltk.downloader.StaleMessageThe package download file is out-of-date or corrupt
class
nltk.downloader.StartCollectionMessageData server has started working on a collection of packages.
class
nltk.downloader.StartDownloadMessageData server has started downloading a package.
class
nltk.downloader.StartPackageMessageData server has started working on a package.
class
nltk.downloader.StartUnzipMessageData server has started unzipping a package.
class
nltk.downloader.UpToDateMessageThe package download file is already up-to-date
class
nltk.draw.cfg.CFGEditorA dialog window for creating and editing context free grammars.
method
nltk.draw.table.Table.append(rowvalue)Add a new row to the end of the table.
method
nltk.draw.table.Table.clear()Delete all rows in this table.
method
nltk.draw.table.Table.extend(rowvalues)Add new rows at the end of the table.
method
nltk.draw.table.Table.focus()Direct (keyboard) input foxus to this widget.
method
nltk.draw.table.Table.hide_column(column_index):see: ``MultiListbox.hide_column()``
method
nltk.draw.table.Table.rowconfigure(row_index, cnf={}, **kw):see: ``MultiListbox.rowconfigure()``
method
nltk.draw.table.Table.select(index=None, delta=None, see=True):see: ``MultiListbox.select()``
method
nltk.draw.table.Table.show_column(column_index):see: ``MultiListbox.show_column()``
class
nltk.draw.tree.TreeWidgetA canvas widget that displays a single Tree.
method
nltk.draw.tree.TreeWidget.bind_click_leaves(callback, button=1)Add a binding to all leaves.
method
nltk.draw.tree.TreeWidget.bind_click_nodes(callback, button=1)Add a binding to all nodes.
method
nltk.draw.tree.TreeWidget.bind_click_trees(callback, button=1)Add a binding to all tree segments.
method
nltk.draw.tree.TreeWidget.bind_drag_leaves(callback, button=1)Add a binding to all leaves.
method
nltk.draw.tree.TreeWidget.bind_drag_nodes(callback, button=1)Add a binding to all nodes.
method
nltk.draw.tree.TreeWidget.bind_drag_trees(callback, button=1)Add a binding to all tree segments.
method
nltk.draw.tree.TreeWidget.toggle_collapsed(treeseg)Collapse/expand a tree.
class
nltk.draw.util.BoxWidgetA canvas widget that places a box around a child widget.
class
nltk.draw.util.CanvasFrameA ``Tkinter`` frame containing a canvas and scrollbars.
method
nltk.draw.util.CanvasFrame.destroy(*e)Destroy this ``CanvasFrame``.
method
nltk.draw.util.CanvasFrame.mainloop(*args, **kwargs)Enter the Tkinter mainloop.
method
nltk.draw.util.CanvasFrame.pack(cnf={}, **kw)Pack this ``CanvasFrame``.
class
nltk.draw.util.ColorizedListAn abstract base class for displaying a colorized list of items.
method
nltk.draw.util.ColorizedList.mark(item)Highlight the given item.
method
nltk.draw.util.ColorizedList.remove_callback(event, func=None)Deregister a callback function.
method
nltk.draw.util.ColorizedList.set(items)Modify the list of items contained by this list.
class
nltk.draw.util.EntryDialogA dialog box for entering
class
nltk.draw.util.OvalWidgetA canvas widget that places a oval around a child widget.
class
nltk.draw.util.ShowTextA ``Tkinter`` window used to display a text.
method
nltk.draw.util.ShowText.mainloop(*args, **kwargs)Enter the Tkinter mainloop.
class
nltk.draw.util.SpaceWidgetA canvas widget that takes up space but does not display anything.
method
nltk.draw.util.SpaceWidget.set_height(height)Change the height of this space widget.
method
nltk.draw.util.SpaceWidget.set_width(width)Change the width of this space widget.
class
nltk.draw.util.TextWidgetA canvas widget that displays a single string of text.
class
nltk.featstruct.FeatDictA feature structure that acts like a Python dictionary.
method
nltk.featstruct.Feature.default()Default value for this feature.
method
nltk.featstruct.Feature.name()The name of this feature.
class
nltk.featstruct.FeatureValueSetA base feature value that is a set of other base feature values.
func
nltk.featstruct.demo(trace=False)Just for testing
class
nltk.grammar.CFGA context-free grammar.
class
nltk.grammar.DependencyGrammarA dependency grammar.
method
nltk.grammar.DependencyGrammar.contains(head, mod):param head: A head word.
class
nltk.grammar.DependencyProductionA dependency grammar production.
class
nltk.grammar.FeatStructNonterminalA feature structure that's also a nonterminal.
class
nltk.grammar.FeatureGrammarA feature-based grammar.
class
nltk.grammar.NonterminalA non-terminal symbol for a context free grammar.
class
nltk.grammar.PCFGA probabilistic context-free grammar.
class
nltk.grammar.ProbabilisticProductionA probabilistic context free grammar production.
class
nltk.grammar.ProductionA grammar production.
func
nltk.grammar.is_nonterminal(item):return: True if the item is a ``Nonterminal``.
class
nltk.inference.api.BaseProverCommandThis class holds a ``Prover``, a goal, and a list of assumptions.
method
nltk.inference.api.BaseProverCommand.prove(verbose=False)Perform the actual proof.
class
nltk.inference.api.ModelBuilderInterface for trying to build a model of set of formulas.
class
nltk.inference.api.ProverInterface for trying to prove a goal from assumptions.
class
nltk.inference.api.ProverCommandThis class holds a ``Prover``, a goal, and a list of assumptions.
method
nltk.inference.api.ProverCommand.prove(verbose=False)Perform the actual proof.
class
nltk.inference.discourse.DiscourseTesterCheck properties of an ongoing discourse.
class
nltk.inference.mace.MaceCommandA ``MaceCommand`` specific to the ``Mace`` model builder.
class
nltk.inference.nonmonotonic.SetHolderA list of sets of Variables.
class
nltk.inference.prover9.Prover9CommandA ``ProverCommand`` specific to the ``Prover9`` prover.
class
nltk.internals.CounterA counter that auto-increments each time its value is read.
class
nltk.internals.DeprecatedA base class used to mark deprecated classes.
class
nltk.internals.ReadErrorException raised by read_* functions when they fail.
func
nltk.internals.deprecated(message)A decorator used to mark functions as deprecated.
func
nltk.jsontags.register_tag(cls)Decorates a class to register it's json tag.
func
nltk.langnames.q2tag(qcode, strict=False)Convert Wikidata Q-code to BCP-47 tag.
func
nltk.langnames.tag2q(tag, strict=False)Convert BCP-47 tag to Wikidata Q-code.
class
nltk.lazyimport.LazyModuleLazy module class.
class
nltk.lm.api.LanguageModelABC for Language Models.
method
nltk.lm.api.LanguageModel.fit(text, vocabulary_text=None)Trains the model on a text.
method
nltk.lm.api.LanguageModel.generate(num_words=1, text_seed=None, random_seed=None)Generate words from the model.
method
nltk.lm.api.LanguageModel.unmasked_score(word, context=None)Score a word given some optional context.
class
nltk.lm.counter.NgramCounterClass for counting ngrams.
method
nltk.lm.counter.NgramCounter.N()Returns grand total number of ngrams stored.
method
nltk.lm.counter.NgramCounter.update(ngram_text)Updates ngram counts from `ngram_text`.
class
nltk.lm.models.AbsoluteDiscountingInterpolatedInterpolated version of smoothing with absolute discount.
class
nltk.lm.models.InterpolatedLanguageModelLogic common to all interpolated language models.
class
nltk.lm.models.KneserNeyInterpolatedInterpolated version of Kneser-Ney smoothing.
class
nltk.lm.models.LaplaceImplements Laplace (add one) smoothing.
class
nltk.lm.models.LidstoneProvides Lidstone-smoothed scores.
class
nltk.lm.models.MLEClass for providing MLE ngram model scores.
class
nltk.lm.models.StupidBackoffProvides StupidBackoff scores.
class
nltk.lm.models.WittenBellInterpolatedInterpolated version of Witten-Bell smoothing.
func
nltk.lm.preprocessing.padded_everygrams(order, sentence)Helper with some useful defaults.
class
nltk.lm.smoothing.AbsoluteDiscountingSmoothing with absolute discount.
class
nltk.lm.smoothing.KneserNeyKneser-Ney Smoothing.
class
nltk.lm.smoothing.WittenBellWitten-Bell smoothing.
class
nltk.lm.vocabulary.VocabularyStores language model vocabulary.
method
nltk.lm.vocabulary.Vocabulary.cutoff()Cutoff value.
method
nltk.lm.vocabulary.Vocabulary.lookup(words)Look up one or more words in the vocabulary.
method
nltk.lm.vocabulary.Vocabulary.update(*counter_args, **counter_kwargs)Update vocabulary counts.
class
nltk.metrics.agreement.AnnotationTaskRepresents an annotation task, i.e.
method
nltk.metrics.agreement.AnnotationTask.Do_Kw(max_distance=1.0)Averaged over all labelers
method
nltk.metrics.agreement.AnnotationTask.S()Bennett, Albert and Goldstein 1954
method
nltk.metrics.agreement.AnnotationTask.alpha()Krippendorff 1980
method
nltk.metrics.agreement.AnnotationTask.pi()Scott 1955; here, multi-pi.
method
nltk.metrics.agreement.AnnotationTask.weighted_kappa(max_distance=1.0)Cohen 1968
method
nltk.metrics.agreement.AnnotationTask.weighted_kappa_pairwise(cA, cB, max_distance=1.0)Cohen 1968
func
nltk.metrics.aline.R(p, q)Return relevant features for segment comparison.
func
nltk.metrics.aline.V(p)Return vowel weight if P is vowel.
func
nltk.metrics.aline.sigma_exp(p, q)Returns score of an expansion/compression.
func
nltk.metrics.aline.sigma_skip(p)Returns score of an indel of P.
func
nltk.metrics.aline.sigma_sub(p, q)Returns score of a substitution of P with Q.
class
nltk.metrics.association.BigramAssocMeasuresA collection of bigram association measures.
class
nltk.metrics.association.QuadgramAssocMeasuresA collection of quadgram association measures.
class
nltk.metrics.association.TrigramAssocMeasuresA collection of trigram association measures.
func
nltk.metrics.distance.binary_distance(label1, label2)Simple equality test.
class
nltk.metrics.paice.PaiceClass for storing lemmas, stems and evaluation metrics.
func
nltk.metrics.paice.demo()Demonstration of the module.
class
nltk.parse.bllip.BllipParserInterface for parsing with BLLIP Parser.
method
nltk.parse.bllip.BllipParser.parse(sentence)Use BLLIP Parser to parse a sentence.
method
nltk.parse.bllip.BllipParser.tagged_parse(word_and_tag_pairs)Use BLLIP to parse a sentence.
class
nltk.parse.chart.AbstractChartRuleAn abstract base class for chart rules.
class
nltk.parse.chart.BottomUpChartParserA ``ChartParser`` using a bottom-up parsing strategy.
class
nltk.parse.chart.CachedTopDownPredictRuleA cached version of ``TopDownPredictRule``.
method
nltk.parse.chart.Chart.edges()Return a list of all edges in this chart.
method
nltk.parse.chart.Chart.initialize()Clear the chart.
class
nltk.parse.chart.ChartParserA generic chart parser.
class
nltk.parse.chart.EdgeIA hypothesis about the structure of part of a sentence.
method
nltk.parse.chart.EdgeI.end()Return the end index of this edge's span.
method
nltk.parse.chart.EdgeI.length()Return the length of this edge's span.
method
nltk.parse.chart.EdgeI.start()Return the start index of this edge's span.
class
nltk.parse.chart.TopDownChartParserA ``ChartParser`` using a top-down parsing strategy.
class
nltk.parse.corenlp.CoreNLPDependencyParserDependency parser.
class
nltk.parse.corenlp.CoreNLPParserSkip these tests if CoreNLP is likely not ready.
class
nltk.parse.corenlp.CoreNLPServerErrorExceptions associated with the Core NLP server.
class
nltk.parse.corenlp.GenericCoreNLPParserInterface to the CoreNLP Parser.
method
nltk.parse.corenlp.GenericCoreNLPParser.parse_sents(sentences, *args, **kwargs)Parse multiple sentences.
method
nltk.parse.corenlp.GenericCoreNLPParser.parse_text(text, *args, **kwargs)Parse a piece of text.
method
nltk.parse.corenlp.GenericCoreNLPParser.raw_parse(sentence, properties=None, *args, **kwargs)Parse a sentence.
method
nltk.parse.corenlp.GenericCoreNLPParser.raw_parse_sents(sentences, verbose=False, properties=None, *args, **kwargs)Parse multiple sentences.
method
nltk.parse.corenlp.GenericCoreNLPParser.raw_tag_sents(sentences, properties=None)Tag multiple sentences.
method
nltk.parse.corenlp.GenericCoreNLPParser.tag(sentence:str, properties=None) -> list[tuple[str, str]]Tag a list of tokens.
method
nltk.parse.corenlp.GenericCoreNLPParser.tag_sents(sentences, properties=None)Tag multiple sentences.
method
nltk.parse.corenlp.GenericCoreNLPParser.tokenize(text, properties=None)Tokenize a string of text.
method
nltk.parse.dependencygraph.DependencyGraph.connect_graph()Fully connects all non-root nodes.
method
nltk.parse.dependencygraph.DependencyGraph.contains_cycle()Check whether there are cycles.
method
nltk.parse.dependencygraph.DependencyGraph.to_conll(style)The dependency graph in CoNLL format.
class
nltk.parse.dependencygraph.DependencyGraphErrorDependency graph exception.
class
nltk.parse.featurechart.FeatureChartA Chart for feature grammars.
class
nltk.parse.malt.MaltParserA class for dependency parsing with MaltParser.
class
nltk.parse.nonprojectivedependencyparser.NonprojectiveDependencyParserA non-projective, rule-based, dependency parser.
class
nltk.parse.nonprojectivedependencyparser.ProbabilisticNonprojectiveParserA probabilistic non-projective dependency parser.
class
nltk.parse.projectivedependencyparser.ProbabilisticProjectiveDependencyParserA probabilistic, projective dependency parser.
class
nltk.parse.projectivedependencyparser.ProjectiveDependencyParserA projective, rule-based, dependency parser.
func
nltk.parse.shiftreduce.demo()A demonstration of the shift-reduce parser.
class
nltk.parse.stanford.GenericStanfordParserInterface to the Stanford Parser
class
nltk.parse.stanford.StanfordDependencyParser>>> dep_parser=StanfordDependencyParser( ...
class
nltk.parse.stanford.StanfordParser>>> parser=StanfordParser( ...
class
nltk.parse.transitionparser.TransitionParserClass for transition based parser.
class
nltk.parse.util.TestGrammarUnit tests for CFG.
func
nltk.parse.viterbi.demo()A demonstration of the probabilistic parsers.
class
nltk.pathsec.ZipFileSecure wrapper for zipfile.ZipFile.
func
nltk.pathsec.open(file, mode='r', *context='pathsec.open', *required_root=None, **kwargs)Secure wrapper for builtins.open.
class
nltk.picklesec.WarningUnpicklerUnpickler that emits PICKLE_WARNING once per instance.
func
nltk.picklesec.pickle_load(file:BinaryIO, *context:str | None=None, *restricted:bool=False) -> AnyConvenience wrapper similar to pickle.load(file).
class
nltk.probability.FreqDistA frequency distribution for the outcomes of an experiment.
method
nltk.probability.FreqDist.freq(sample)Return the frequency of a given sample.
class
nltk.probability.KneserNeyProbDistKneser-Ney estimate of a probability distribution.
class
nltk.probability.ProbDistIA probability distribution for the outcomes of an experiment.
method
nltk.probability.ProbDistI.prob(sample)Return the probability for a given sample.
class
nltk.probability.WittenBellProbDistThe Witten-Bell estimate of a probability distribution.
class
nltk.sem.boxer.BoxerDrsParserReparse the str form of subclasses of ``AbstractBoxerDrs``
func
nltk.sem.chat80.sql_query(dbname, query)Execute an SQL query over a database.
class
nltk.sem.drt.DRSA Discourse Representation Structure.
method
nltk.sem.drt.DRS.free():see: Expression.free()
method
nltk.sem.drt.DRS.get_refs(recursive=False):see: AbstractExpression.get_refs()
method
nltk.sem.drt.DRS.visit(function, combinator):see: Expression.visit()
method
nltk.sem.drt.DRS.visit_structured(function, combinator):see: Expression.visit_structured()
class
nltk.sem.drt.DrtConcatenationDRS of the form '(DRS + DRS)'
method
nltk.sem.drt.DrtConcatenation.get_refs(recursive=False):see: AbstractExpression.get_refs()
method
nltk.sem.drt.DrtConcatenation.visit(function, combinator):see: Expression.visit()
class
nltk.sem.drt.DrtParserA lambda calculus expression parser.
method
nltk.sem.drt.DrtParser.get_all_symbols()This method exists to be overridden
class
nltk.sem.evaluate.AssignmentA dictionary which represents an assignment of values to variables.
method
nltk.sem.evaluate.Assignment.purge(var=None)Remove one or all keys (i.e.
class
nltk.sem.evaluate.ModelA first order model is a domain *D* of discourse and a valuation *V*.
method
nltk.sem.evaluate.Model.i(parsed, g, trace=False)An interpretation function.
func
nltk.sem.evaluate.arity(rel)Check the arity of a relation.
func
nltk.sem.evaluate.demo(num=0, trace=None)Run exists demos.
func
nltk.sem.evaluate.folmodel(quiet=False, trace=None)Example of a first-order model.
func
nltk.sem.evaluate.propdemo(trace=None)Example of a propositional model.
class
nltk.sem.linearlogic.LinearLogicParserA linear logic expression parser.
class
nltk.sem.logic.AndExpressionThis class represents conjunctions
method
nltk.sem.logic.BinaryExpression.findtype(variable):see Expression.findtype()
method
nltk.sem.logic.BinaryExpression.visit(function, combinator):see: Expression.visit()
class
nltk.sem.logic.EqualityExpressionThis class represents equality expressions like "(x = y)".
class
nltk.sem.logic.ExpressionThis is the base abstract object for all logical expressions
method
nltk.sem.logic.Expression.equiv(other, prover=None)Check for logical equivalence.
method
nltk.sem.logic.Expression.normalize(newvars=None)Rename auto-generated unique variables
method
nltk.sem.logic.Expression.typecheck(signature=None)Infer and check types.
method
nltk.sem.logic.Expression.visit(function, combinator)Recursively visit subexpressions.
method
nltk.sem.logic.Expression.visit_structured(function, combinator)Recursively visit subexpressions.
class
nltk.sem.logic.IffExpressionThis class represents biconditionals
class
nltk.sem.logic.ImpExpressionThis class represents implications
class
nltk.sem.logic.LogicParserA lambda calculus expression parser.
method
nltk.sem.logic.LogicParser.get_all_symbols()This method exists to be overridden
method
nltk.sem.logic.LogicParser.parse(data, signature=None)Parse the expression.
method
nltk.sem.logic.LogicParser.process(data)Split the data into tokens
method
nltk.sem.logic.LogicParser.token(location=None)Get the next waiting token.
method
nltk.sem.logic.NegatedExpression.negate():see: Expression.negate()
method
nltk.sem.logic.NegatedExpression.visit(function, combinator):see: Expression.visit()
class
nltk.sem.logic.OrExpressionThis class represents disjunctions
func
nltk.sem.logic.binding_ops()Binding operators
func
nltk.sem.logic.boolean_ops()Boolean operators
func
nltk.sem.logic.equality_preds()Equality predicates
func
nltk.sem.logic.unique_variable(pattern=None, ignore=None)Return a new, unique variable.
func
nltk.sem.relextract.class_abbrev(type)Abbreviate an NE class name.
func
nltk.sem.relextract.clause(reldict, relsym)Print the relation in clausal form.
func
nltk.sem.relextract.rtuple(reldict, lcon=False, rcon=False)Pretty print the reldict as an rtuple.
class
nltk.sentiment.vader.SentimentIntensityAnalyzerGive a sentiment intensity score to sentences.
class
nltk.sentiment.vader.VaderConstantsA class to keep the Vader lists and constants.
class
nltk.stem.api.StemmerIA processing interface for removing morphological affixes from words.
class
nltk.stem.arlstem2.ARLSTem2Return a stemmed Arabic word after removing affixes.
method
nltk.stem.arlstem2.ARLSTem2.adjective(token)remove the infixes from adjectives
method
nltk.stem.arlstem2.ARLSTem2.pref(token)remove prefixes from the words' beginning.
method
nltk.stem.arlstem2.ARLSTem2.stem1(token)call this function to get the first stem
method
nltk.stem.arlstem2.ARLSTem2.suff(token)remove the suffixes from the word's ending.
method
nltk.stem.arlstem2.ARLSTem2.verb(token)stem the verb prefixes and suffixes or both
method
nltk.stem.arlstem2.ARLSTem2.verb_t3(token)stem the present tense suffixes
method
nltk.stem.arlstem2.ARLSTem2.verb_t4(token)stem the present tense prefixes
method
nltk.stem.arlstem2.ARLSTem2.verb_t5(token)stem the future tense prefixes
method
nltk.stem.arlstem2.ARLSTem2.verb_t6(token)stem the imperative tense prefixes
class
nltk.stem.porter.PorterStemmerA word stemmer based on the Porter stemming algorithm.
class
nltk.stem.rslp.RSLPStemmerA stemmer for Portuguese.
class
nltk.stem.snowball.DanishStemmerThe Danish Snowball stemmer.
class
nltk.stem.snowball.DutchStemmerThe Dutch Snowball stemmer.
class
nltk.stem.snowball.EnglishStemmerThe English Snowball stemmer.
class
nltk.stem.snowball.FinnishStemmerThe Finnish Snowball stemmer.
class
nltk.stem.snowball.FrenchStemmerThe French Snowball stemmer.
class
nltk.stem.snowball.GermanStemmerThe German Snowball stemmer.
class
nltk.stem.snowball.HungarianStemmerThe Hungarian Snowball stemmer.
class
nltk.stem.snowball.ItalianStemmerThe Italian Snowball stemmer.
class
nltk.stem.snowball.NorwegianStemmerThe Norwegian Snowball stemmer.
class
nltk.stem.snowball.PorterStemmerA word stemmer based on the original Porter stemming algorithm.
class
nltk.stem.snowball.PortugueseStemmerThe Portuguese Snowball stemmer.
class
nltk.stem.snowball.RomanianStemmerThe Romanian Snowball stemmer.
class
nltk.stem.snowball.RussianStemmerThe Russian Snowball stemmer.
class
nltk.stem.snowball.SpanishStemmerThe Spanish Snowball stemmer.
class
nltk.stem.snowball.SwedishStemmerThe Swedish Snowball stemmer.
class
nltk.tag.api.FeaturesetTaggerIA tagger that requires tokens to be ``featuresets``.
class
nltk.tag.api.TaggerIA processing interface for assigning a tag to each token in a list.
class
nltk.tag.brill.BrillTaggerBrill's transformational rule-based tagger.
class
nltk.tag.brill.PosFeature which examines the tags of nearby tokens.
method
nltk.tag.brill.Pos.extract_property(tokens, index)@return: The given token's tag.
class
nltk.tag.brill.WordFeature which examines the text (word) of nearby tokens.
method
nltk.tag.brill.Word.extract_property(tokens, index)@return: The given token's text.
class
nltk.tag.brill_trainer.BrillTaggerTrainerA trainer for tbl taggers.
class
nltk.tag.hmm.HiddenMarkovModelTrainerAlgorithms for learning HMM parameters from training data.
class
nltk.tag.hunpos.HunposTaggerA class for pos tagging with HunPos.
method
nltk.tag.hunpos.HunposTagger.close()Closes the pipe to the hunpos executable.
method
nltk.tag.hunpos.HunposTagger.tag(tokens)Tags a single sentence: a list of words.
class
nltk.tag.perceptron.AveragedPerceptronAn averaged perceptron, as implemented by Matthew Honnibal.
method
nltk.tag.perceptron.AveragedPerceptron.load(path)Load the json model weights.
method
nltk.tag.perceptron.AveragedPerceptron.save(path)Save the model weights as json
method
nltk.tag.perceptron.AveragedPerceptron.update(truth, guess, features)Update the feature weights.
class
nltk.tag.sequential.ClassifierBasedPOSTaggerA classifier based part of speech tagger.
class
nltk.tag.sequential.DefaultTaggerA tagger that assigns the same tag to every token.
class
nltk.tag.stanford.StanfordNERTaggerA class for Named-Entity Tagging with Stanford Tagger.
class
nltk.tag.stanford.StanfordPOSTaggerA class for pos tagging with Stanford Tagger.
class
nltk.tag.stanford.StanfordTaggerAn interface to Stanford taggers.
class
nltk.tag.tnt.TnTTnT statistical part of speech tagger.
method
nltk.tag.tnt.TnT.tag(tokens, segment=False)Tag a single sentence.
method
nltk.tag.tnt.TnT.tagdata(data, segment=False)Tags a list of sentences.
func
nltk.tag.tnt.demo(test_size=1000)Evaluate TnT on a held-out Treebank slice.
func
nltk.tbl.demo.demo()Run a demo with defaults.
func
nltk.tbl.demo.demo_high_accuracy_rules()Discard rules with low accuracy.
func
nltk.tbl.demo.demo_template_statistics()Show aggregate statistics per template.
func
nltk.tbl.demo.demo_verbose_rule_format()Exemplify Rule.format("verbose")
class
nltk.tbl.feature.FeatureAn abstract base class for Features.
method
nltk.tbl.rule.Rule.format(fmt)Return a string representation of this rule.
class
nltk.text.ContextIndexA bidirectional index between words and their 'contexts' in a text.
method
nltk.text.Text.vocab():seealso: nltk.prob.FreqDist
class
nltk.tgrep.TgrepExceptionTgrep exception type.
class
nltk.tokenize.api.TokenizerIA processing interface for tokenizing a string.
method
nltk.tokenize.api.TokenizerI.tokenize(s:str) -> list[str]Return a tokenized copy of *s*.
method
nltk.tokenize.api.TokenizerI.tokenize_sents(strings:list[str]) -> list[list[str]]Apply ``self.tokenize()`` to each element of ``strings``.
class
nltk.tokenize.casual.TweetTokenizerTokenizer for tweets.
method
nltk.tokenize.casual.TweetTokenizer.PHONE_WORD_RE() -> 'regex.Pattern'Secondary core TweetTokenizer regex
About this data
These signatures were extracted from the public source of nltk/nltk
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.