How to use the pyknp.KNP function in pyknp

To help you get started, we’ve selected a few pyknp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ku-nlp / pyknp / pyknp / knp / simple.py View on Github external
#-*- encoding: utf-8 -*-

from __future__ import absolute_import
from pyknp import KNP

my_knp = KNP()


def knp(input_str):
    return my_knp.parse(input_str)
github aistairc / trf / trf / modality.py View on Github external
def __init__(self, text, delimiter='\n'):
        """
        Args:
            text (str)
            delimiter (str)
        """
        self.sentences = util.split_text(text, delimiter)
        self.n_sentence = len(self.sentences)
        self.parser = KNP(option=DefaultOptions.KNP)
        self.rates = self._rates()
github aistairc / trf / trf / analyser.py View on Github external
def __init__(self, text: str, delimiter: str = '\n'):
        self.text = text
        self.delimiter = delimiter
        self.sentences = util.split_text(self.text, delimiter)
        self.n_sentences = len(self.sentences)
        self.knp = KNP(option=DefaultOptions.KNP)
        self.trees = self._trees()
        self.juman = Juman()
        self.rs_pos = self.calc_rs_pos()
        self.n_mrphs = self.calc_n_mrphs()
        self.n_chunks = self.calc_n_chunks()
        self.n_types = self.calc_n_types()
        self.mean_n_mrphs = None \
            if self.n_sentences == 0 \
            else self.n_mrphs / self.n_sentences
        self.rs_modality = self.calc_rs_modality()
        self.r_conditional = None \
            if self.n_sentences == 0 \
            else self.calc_n_conditionals() / self.n_sentences
        self.mean_tree_depths = self.calc_mean_tree_depths()

pyknp

Python module for JUMAN/KNP

See COPYING
Latest version published 3 years ago

Package Health Score

52 / 100
Full package analysis

Similar packages