Code Monkey home page Code Monkey logo

Comments (2)

hyunwoongko avatar hyunwoongko commented on August 19, 2024

안녕하세요. 일단 지금 구현은 맨 처음에 한번만 로드하도록 되어있습니다.
https://github.com/hyunwoongko/kss/blob/main/kss/morph.py#L31
혹시 하나의 프로세스에서 Pynori가 초기화가 여러번 일어난다는 말씀이실까요?

그런게 아니라면, 시간이 오래 걸리는 부분은 객체가 메모리에 올라오면서 시간이 많이 소요됩니다. 따라서 프로세스가 메모리에서 내려가고 나면 다시 실행할때 이를 다시 메모리에 올려야 합니다.

from kss.

hyunwoongko avatar hyunwoongko commented on August 19, 2024

다만 성능을 개선할 수 있는 몇가지 옵션을 제공하고 있습니다. 우선 Pynori 대신 Mecab 백엔드를 사용하시면 시간을 아낄 수 있으시고, Mecab 설치가 여의치 않으시면 none 백엔드를 이용하시면 시간을 절약할 수 있습니다. 다만 none 백엔드를 이용할시에는 분석성능이 감소됩니다.

>>> from kss import split_sentences
  
>>> text = "부디 만수무강 하옵소서 천천히 가세용~ 너 밥을 먹는구나 응 맞아 난 근데 어제 이사했음 그랬구나 이제 마지막임 응응"

>>> split_sentences(text, backend="pynori")
['부디 만수무강 하옵소서', '천천히 가세용~', '너 밥을 먹는구나', '응 맞아 난 근데 어제 이사했음', '그랬구나 이제 마지막임', '응응']

>>> split_sentences(text, backend="mecab")
['부디 만수무강 하옵소서', '천천히 가세용~', '너 밥을 먹는구나', '응 맞아 난 근데 어제 이사했음', '그랬구나 이제 마지막임', '응응']

>>> split_sentences(text, backend="none")
['부디 만수무강 하옵소서 천천히 가세용~', '너 밥을 먹는구나 응 맞아 난 근데 어제 이사했음 그랬구나 이제 마지막임 응응'

또한 멀티프로세스를 지원합니다! 리스트를 입력으로 넣으시면 멀티프로세스를 사용해서 보다 속도를 개선할 수 있습니다. 더 자세한 내용은 https://github.com/hyunwoongko/kss/blob/main/docs/ANALYSIS.md#3-segmentation-speed-analysis 요기를 참고해주시면 감사하겠습니다~

from kss.

Related Issues (20)

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.