Giter VIP home page Giter VIP logo

namedivider-python's People

Contributors

rskmoi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

namedivider-python's Issues

GBDTNameDivider() occurs FileNotFoundError

GBDTNameDivider occurs FileNotFoundError in environment that user cache directory (/Users/"user_name"/.cache) is not exist.

I paste traceback message when I do sample code and occurs error.

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
/var/folders/cl/wm2yh_cj509fjnj8d5nw0vtw0000gn/T/ipykernel_12025/2559231275.py in <module>
      8 basic_divider = BasicNameDivider() # BasicNameDivider is fast but accuracy is 99.2%
      9 
---> 10 gbdt_divider = GBDTNameDivider() # GBDTNameDivider is slow but accuracy is 99.9%
     11 divided_name = gbdt_divider.divide_name("菅義偉")
     12 print(divided_name)

~/.pyenv/versions/anaconda3-2021.11/envs/ai_study/lib/python3.9/site-packages/namedivider/divider/gbdt_name_divider.py in __init__(self, config)
     21             config = GBDTNameDividerConfig()
     22         super().__init__(config=config)
---> 23         download_family_name_pickle_if_needed(config.path_family_names)
     24         download_gbdt_model_v1_if_needed(config.path_model)
     25         kanji_statistics_repository = KanjiStatisticsRepository(path_csv=config.path_csv)

~/.pyenv/versions/anaconda3-2021.11/envs/ai_study/lib/python3.9/site-packages/namedivider/util.py in download_family_name_pickle_if_needed(path)
     39     if path.exists():
     40         return None
---> 41     DEFAULT_CACHE_DIR.mkdir(exist_ok=True)
     42     print("Download FamilyNameRepository from GitHub...")
     43     content = requests.get(FAMILY_NAME_REPOSITORY_URL).content

~/.pyenv/versions/anaconda3-2021.11/envs/ai_study/lib/python3.9/pathlib.py in mkdir(self, mode, parents, exist_ok)
   1321         """
   1322         try:
-> 1323             self._accessor.mkdir(self, mode)
   1324         except FileNotFoundError:
   1325             if not parents or self.parent == self:

FileNotFoundError: [Errno 2] No such file or directory: '/Users/"user_name"/.cache/namedivider-python'

I tried to fix.
namedivider/util.py L.41 changes "DEFAULT_CACHE_DIR.mkdir(exist_ok=True)" -> "DEFAULT_CACHE_DIR.mkdir(exist_ok=True, parents=True)".
But, error cannot fix...

I make /Users/"user_name"/.cache directory by mkdir command. This error don't occurs.

I fixed this problem by myself, but, other user may gets same error and this issue has possibility of useful for you. So, I will report this error in issue.

There are cases where the expected results are not obtained.

I don't think it can be divided perfectly in all cases, but I think it will be helpful for improvement.

input expected result
中臣鎌足 中臣 鎌足 中 臣鎌足
豊臣秀吉 豊臣 秀吉 豊 臣秀吉
聖徳太子 聖徳 太子 聖 徳太子

[Feature Request] Generate all possible Furigana from Kanji Name

First of all, thank you so much @rskmoi for making this package! I tried the demo on https://rskmoi-namedivider-python-examplesdemoexample-streamlit-x2ba84.streamlit.app/ and the results are amazing!
I intend to try it out in our business card management application to increase the accuracy of name dividing.

I have a request: Is it possible to get Kanji names Furigana too, especially all the possible candidates? OSS packages like Sudachi give only one candidate for the Furigana but I would like all possible suggestions for the Furigana.
For example, for the family name "大谷" Sudachi gives "オオヤ" as the output (please see attachment) but probably "オオタニ" is a more common Furigana of the name.
Screenshot 2023-12-03 at 13 35 03

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.