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

사용자 사전 기능 #57

Open
mrchypark opened this issue Apr 23, 2022 · 6 comments
Open

사용자 사전 기능 #57

mrchypark opened this issue Apr 23, 2022 · 6 comments

Comments

@mrchypark
Copy link
Owner

현재 kiwi 기능에 의존하기만 하는 상태임.

편의 기능이 있기를 생각하고 있으며, 문제는 kiwi에서 제공하는 기능이 종류가 좀 많아졌음.
이걸 어떻게 커버할지 고민이 필요.

@mrchypark
Copy link
Owner Author

stopwords가 class로 나와 있어서, 사용자 사전을 밖으로 빼는 것이 좋겠다는 생각이 듬.

@mrchypark mrchypark pinned this issue Jun 18, 2022
@dataminds
Copy link

안녕하세요. R Wrapper만들어주셔서 잘쓰고 있습니다. 사용자사전을 추가할 수 있는 함수명이 설명서에는 안보이는데, 사용자사전을 추가하는 방법이 있을까요?

@sunwoopark
Copy link

저도 dataminds님처럼 사용자사전을 추가할 수 있는 함수를 어떻게 사용하는지 궁금합니다. 더불어 KoNLP에는 명사를 추출하는 extractNoun이라는 함수가 있어서 이 함수를 tidytext에 결합해서 사용하는데 elbird에도 명사만 추출하거나 특정 품사만 추출하는 함수를 사용할 수 있나요?

@mrchypark
Copy link
Owner Author

@dataminds 이곳을 보시면 사용자 사전을 추가하는 예시가 중간 정도에 표현되어 있습니다. 부족한 부분이 있으면 알려주세요. https://mrchypark.github.io/elbird/articles/kiwi-class.html

@mrchypark
Copy link
Owner Author

@sunwoopark 안녕하세요, tidytext와 사용하실 때는 형태소/태그 형태로 되어 있어서 string contain 으로 필터하셔야 합니다. 예시 코드를 드리겠습니다.

library(tidytext)
library(dplyr)
library(tibble)
library(stringr)
library(elbird)

tar <- as_tibble(c("예시텍스트", "여러개 입니다."))
kw <- Kiwi$new()

token_func <- kw$get_tidytext_func()

unnest_tokens(
  tar,
  input = value,
  output = word,
  token = tokenize_tidy
) %>% 
  filter(str_detect(word, "ef"))

str_detect 함수는 정규표현식을 받기 때문에 정규표현식을 조금 아시면 도움이 됩니다.
감사합니다.

@sunwoopark
Copy link

감사합니다. filter(str_detect(word, "ef"))의 품사정보 태그 부분인 "ef"를 수정해서 사용하면 되겠네요. 많은 도움이 되었습니다.

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

No branches or pull requests

3 participants