megagonlabs / bunkai Goto Github PK
View Code? Open in Web Editor NEWSentence boundary disambiguation tool for Japanese texts (日本語文境界判定器)
Home Page: https://pypi.org/project/bunkai/
License: Apache License 2.0
Sentence boundary disambiguation tool for Japanese texts (日本語文境界判定器)
Home Page: https://pypi.org/project/bunkai/
License: Apache License 2.0
「ご飯を食べた。│」と彼は言った (current)
「ご飯を食べた。」│と彼は言った (better?)
Getting the following error as I follow the readme. I hope what I do in what environment is already clear... Let me know if you need more info
Python 3.11.6 (main, Nov 2 2023, 04:39:40) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
from bunkai import Bunkai
from pathlib import Path
bunkai=Bunkai(path_model=Path('bunkai-model-directory'))
Traceback (most recent call last):
File "", line 1, in
File "/opt/homebrew/lib/python3.11/site-packages/bunkai/algorithm/bunkai_sbd/bunkai_sbd.py", line 78, in init
_annotators.insert(_idxs[0] + 1, LinebreakAnnotator(path_model=path_model))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/bunkai/algorithm/bunkai_sbd/annotator/linebreak_annotator.py", line 16, in init
self.linebreak_detector = Predictor(modelpath=path_model)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/bunkai/algorithm/lbd/predict.py", line 43, in init
self.tokenizer = JanomeSubwordsTokenizer(self.path_tokenizer_model)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/bunkai/algorithm/lbd/custom_tokenizers.py", line 136, in init
super(BertTokenizer, self).init(
File "/opt/homebrew/lib/python3.11/site-packages/transformers/tokenization_utils.py", line 367, in init
self._add_tokens(
File "/opt/homebrew/lib/python3.11/site-packages/transformers/tokenization_utils.py", line 467, in _add_tokens
current_vocab = self.get_vocab().copy()
^^^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/transformers/models/bert/tokenization_bert.py", line 240, in get_vocab
return dict(self.vocab, **self.added_tokens_encoder)
^^^^^^^^^^
AttributeError: 'JanomeSubwordsTokenizer' object has no attribute 'vocab'
File "/path/to/work/.venv/lib/python3.7/site-packages/bunkai/algorithm/bunkai_sbd/bunkai_sbd.py", line 89, in __call__
annotations = self.eos(text)
File "/path/to/work/.venv/lib/python3.7/site-packages/bunkai/algorithm/bunkai_sbd/bunkai_sbd.py", line 79, in eos
rule_obj.annotate(text, annotations)
File "/path/to/work/.venv/lib/python3.7/site-packages/bunkai/algorithm/bunkai_sbd/annotator/indirect_quote_exception_annotator.py", line 137, in a
nnotate
index2token_obj=index2token_obj):
File "/path/to/work/.venv/lib/python3.7/site-packages/bunkai/algorithm/bunkai_sbd/annotator/indirect_quote_exception_annotator.py", line 101, in i
s_exception_particle
for rule_object in MORPHEMES_AFTER_CANDIDATE]):
File "/path/to/work/.venv/lib/python3.7/site-packages/bunkai/algorithm/bunkai_sbd/annotator/indirect_quote_exception_annotator.py", line 101, in <
listcomp>
for rule_object in MORPHEMES_AFTER_CANDIDATE]):
File "/path/to/work/.venv/lib/python3.7/site-packages/bunkai/algorithm/bunkai_sbd/annotator/indirect_quote_exception_annotator.py", line 45, in is
_rule_valid
if self.rule_word_surface[i_rule_morpheme] != index2token_obj[__check].word_surface:
KeyError: 107747
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.