分享

nltk study

 大傻子的文渊阁 2020-12-17
  • class AbstractCollocationFinder(object):

    • """An abstract base class for collocationfinders whose purpose is to collect collocation candidate frequencies, filterand rank them.

    • As a minimum, collocation finders requirethe frequencies of each word in a corpus, and the joint frequency of word tuples.This data should be provided through nltk.probability.FreqDist objects or an identicalinterface."""

  • class BigramCollocationFinder(AbstractCollocationFinder):

    • """A tool for the findingand ranking of bigram collocations or other association measures. It is oftenuseful to use from_words() rather than constructing an instance directly."""

  • class TrigramCollocationFinder(AbstractCollocationFinder):

    • """A tool for the findingand ranking of trigram collocations or other association measures. It is oftenuseful to use from_words() rather than constructing an instance directly."""

  • class QuadgramCollocationFinder(AbstractCollocationFinder):

    • """A tool for the findingand ranking of quadgram collocations or other association measures. It is oftenuseful to use from_words() rather than constructing an instance directly."""

    • def decorator(caller):

      • """General purpose decorator factory: takes acaller function as input and returns a decorator with the same attributes.A caller function is any function likethis::

    • def new_wrapper(wrapper, model):

      • """An improvement overfunctools.update_wrapper. The wrapper is a generic callable object. It works bygenerating a copy of the wrapper with the right signature and by updating thecopy, not the original.

      • Moreovoer, 'model' can be a dictionary withkeys 'name', 'doc', 'module', 'dict', 'defaults'."""

    • def getinfo(func):

      • """Returns an info dictionary containing:

      • - name (the name of the function : str)

      • - argnames (the names of the arguments :list)

      • - defaults (the values of the defaultarguments : tuple)

      • - signature (the signature : str)

      • - fullsignature (the full signature :Signature)

      • - doc (the docstring : str)

      • - module (the module name : str)

      • - dict (the function __dict__ : str)

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多