Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stopwords 기능 구현 #310

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

stopwords 기능 구현 #310

wants to merge 15 commits into from

Conversation

hexists
Copy link
Contributor

@hexists hexists commented Jun 12, 2020

안녕하세요.

#184 이슈를 보고, konlpy를 위한 stopwords 기능을 구현했습니다.
stopwords 구현을 위해, 여러 경로에서 stopwords를 수집했습니다.

아래 파일들을 이용해서 stopwords.word.txt와 stopwords.morph.txt 파일을 생성했습니다.
(stopwords.word.txt, stopwords.morph.txt를 생성하는 프로그램은 별도의 repo에 정리했습니다.)

file source unit license
bab2min.txt bab2min morph 저자에게 사용 허락 받음
ranksnl.txt ranks.nl word MIT로 추정
spikeekips.txt spikeekips gist word 저자에게 사용 허락 받음
6.txt 6 github word apache 2.0
stopwords-iso.txt stopwords-iso github word MIT
many-stop-words.txt many-stop-words word MIT

CONTRIBUTING에 따라 PR 보내기 전 과정을 수행했습니다.
make check, make testall 과정 중 오류가 있었지만, 본 기능과 관련이 없어 보여 PR 보냅니다.
(관련 오류는 #309 에 이슈로 등록했습니다.)

사용 방법입니다.

형태소 단위와 단어 단위에 대한 stopwords를 제공합니다.
함수의 사용법은 nltk와 유사하게 개발했습니다.

  • stopwords 불러오기
 >>> from konlpy.corpus import stopwords
  • stopwords 사용하기(단어 단위)
>>> stopwords.words()
['!', '"', '$', ... ]
  • stopwords 사용하기(형태소 단위)
>>> stopwords.morphs(analyzer='kkma')
['가/VV', '가지/VV', '같/VA', ... ]
  • stopwords 추가하기
>>> stopwords.include('word', ['헐', '네'])
  • stopwords 제외하기
 >>> stopwords.exclude('word', ['진짜'])

PR을 보내면서 몇가지 질문이 있습니다.

  1. stopwords를 생성하는 프로그램과 raw 파일 또한 konlpy에 추가하는 것이 좋을까요?
    그렇다면, 어떤 경로에 추가되는 것이 좋을지 의견 부탁드립니다.
  2. 신규 기능에 대한 문서는 어떻게 작성하면 되나요? pydoc을 통해 그대로 반영되는 것인지 궁금합니다.

신규 기능에 대한 검토 부탁드립니다.

@sunglok
Copy link

sunglok commented Apr 28, 2021

유용한 contribution 감사합니다. 위의 질문에 대한 제 의견을 적습니다.

  1. txt 파일을 생성하는 부분은 사람마다 의견이 갈릴 것 같은데, 최종 txt 파일과 stopwords 관련 함수는 추가하면 좋을 것 같습니다.

  2. 위와 같이 KoNLPy에 공식적인 기능으로 배포되면 pydoc을 통해 해당 기능에 대한 사용법을 추가하면 좋을 것 같습니다.

@hexists
Copy link
Contributor Author

hexists commented May 22, 2021

유용한 contribution 감사합니다. 위의 질문에 대한 제 의견을 적습니다.

  1. txt 파일을 생성하는 부분은 사람마다 의견이 갈릴 것 같은데, 최종 txt 파일과 stopwords 관련 함수는 추가하면 좋을 것 같습니다.
  2. 위와 같이 KoNLPy에 공식적인 기능으로 배포되면 pydoc을 통해 해당 기능에 대한 사용법을 추가하면 좋을 것 같습니다.

@sunglok 의견 감사합니다.

  1. 최종 txt 파일 만드는 부분과 stopwords 관련 함수는 어떻게 추가하는게 좋을지 고민해보고 추가해보겠습니다.
  2. pydoc에 해당 설명 추가해보겠습니다.

궁금한 점이 있습니다.
혹시 txt 파일에 대해 의견이 갈릴 것 같다는 부분에 대해 좀 더 설명해 주실 수 있을까요? 어떤 의견이 있을지 궁금합니다^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants