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

Add stopwords #60

Merged
merged 3 commits into from
Nov 12, 2021
Merged

Add stopwords #60

merged 3 commits into from
Nov 12, 2021

Conversation

HyejuSeon
Copy link
Contributor

안녕하세요.
#53 에서 논의한 stopwors 기능을 구현했습니다.

미리 말씀드린 것처럼 AI Hub, 모두의 말뭉치의 코퍼스를 이용해서 TF 상위 100개를 뽑아 stopwords.txt를 만들었습니다.
다만, 제안해 주신 인터페이스에서 아래와 같은 수정 사항이 있어 확인해 주시면 감사하겠습니다.

from kiwipiepy.utils import Stopwords
stopwords = Stopwords() # stopword

('김가네', 'NNP') in stopwords.word() # stopwords 내에 단어 포함 여부 테스트

Copy link
Owner

@bab2min bab2min left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HyejuSeon
기능들이 많은데 잘 구현해주셔서 감사합니다~!
대부분 문제 없지만, 일부 잠재적으로 문제가 될 수 있는 코드나 효율적인 방법이 있는듯해서 코멘트를 남겼습니다. 한번 찬찬히 살펴보시고 궁금하신거나 이견 있으시면 편하게 피드백 남겨주세요~

p.s. 앗, 추가로 Stopwords 클래스 내의 load_stopwords, tag_exists, token_exists 메서드는 외부에서 호출할 일이 없으므로, 이름 앞에 _를 붙여서 감추는게 좋아보여요.

cc. @hexists

test.py Outdated Show resolved Hide resolved
kiwipiepy/utils.py Outdated Show resolved Hide resolved
kiwipiepy/utils.py Outdated Show resolved Hide resolved
kiwipiepy/utils.py Show resolved Hide resolved
kiwipiepy/utils.py Outdated Show resolved Hide resolved
kiwipiepy/utils.py Outdated Show resolved Hide resolved
Copy link
Owner

@bab2min bab2min left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HyejuSeon
지금 다시 보니 self.stopwords도 list 타입으로 처리하고 있더라구요. 이것도 set 타입으로 바꾸는게 좋을거 같아서 추가 코멘트 남겼습니다~

kiwipiepy/utils.py Show resolved Hide resolved
kiwipiepy/utils.py Outdated Show resolved Hide resolved
@bab2min
Copy link
Owner

bab2min commented Nov 12, 2021

@HyejuSeon
macOS에서 테스트에 실패하긴 했는데, 이건 stopwords 코드의 문제가 아니라 github workflows에서 제공하는 macOS 버전 변경으로 인한거네요~ 이부분 테스트는 통과한걸로 보고 머지 진행하도록 할게요!

@bab2min bab2min merged commit 63ce9f4 into bab2min:main Nov 12, 2021
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

2 participants