lovit / soyspacing Goto Github PK
View Code? Open in Web Editor NEW띄어쓰기 오류 교정 라이브러리입니다. CRF 와 같은 머신러닝 알고리즘이 아닌, 직관적인 접근법으로 띄어쓰기를 교정합니다.
띄어쓰기 오류 교정 라이브러리입니다. CRF 와 같은 머신러닝 알고리즘이 아닌, 직관적인 접근법으로 띄어쓰기를 교정합니다.
space_tag 함수의 return 값에서 마지막 글자의 띄어쓰기 태그가 반드시 1
로 지정되기 때문에 RuleDict 가 적용되지 않습니다. 이를 해결하기 위하여 RuleDict 가 입력될 때에는 tags[-1] = None 으로 설정한 뒤, RuleDict 적용 후 다시 tags[-1] = 1 로 변경해야 합니다.
model.correct(sent, verbose, mc, ft, nt, st, rules=rule_dict)
=====>
TypeError Traceback (most recent call last)
in ()
----> 1 model.correct(sent, verbose, mc, ft, nt, st, rules=rule_dict)
~/anaconda3/envs/tensorflow/lib/python3.6/site-packages/soyspacing/countbase/_countbase.py in correct(self, doc, sep, verbose, min_count, force_abs_threshold, nonspace_threshold, space_threshold, space_importancy, rules, debug)
317 if verbose:
318 self.print_tags(tags, head = 'Input:')
--> 319 print(self.space(chars, tags, sep))
320
321 # rule-based tagging
~/anaconda3/envs/tensorflow/lib/python3.6/site-packages/soyspacing/countbase/_countbase.py in space(self, chars, tags, sep)
268
269 def space(self, chars, tags, sep=' '):
--> 270 return ''.join([c+sep if t==1 else c for c,t in zip(chars, tags)]).strip()
271
272
~/anaconda3/envs/tensorflow/lib/python3.6/site-packages/soyspacing/countbase/_countbase.py in (.0)
268
269 def space(self, chars, tags, sep=' '):
--> 270 return ''.join([c+sep if t==1 else c for c,t in zip(chars, tags)]).strip()
271
272
TypeError: must be str, not bool
실제 학습시간은 어떻게 계산하나요?
usb메모리
를 usb
메모리
로 분리하도록 하고 싶은데요.
학습 데이터를 어떻게 준비하면 될까요?
3단우산도 역시 띄어져야 하고요.
from soyspacing.countbase import CountSpace, RuleDict
model = CountSpace()
rule_dict = RuleDict('tutorials/space_rules.txt')
sent, tags = model.correct('안되는가게로 한국정말로')
print(sent) # 안되는가게로 한국정말로
print(tags) # [None, None, None, None, None, 1, None, None, None, None, 1]
안녕하세요 ! 우선 좋은 모델 만들어주셔서 감사합니다 : )
띄어쓰기 때문에 간단한 리뷰 데이터 NLP 과정에서도 오류가 많아 좀 개선해보고자 찾아보다가 soyspacing을 발견했네요 !
현재 산업군과 연관성 높으면서 띄어쓰기가 어느정도 잘 되어있는 텍스트 데이터를 수집 했고, soyspacing으로 모델 생성 해보려고 시도 중입니다.
생각보다 학습이 잘 안되는 것 같아서,, 입력데이터를 조정해보면서 최적화 해보려 하는데요.
혹시 학습시킬 txt 파일의 데이터 입력 형태가 영향을 줄까요 ?
예를들어 특정 article 들의 본문 데이터를 수집 해서 txt로 저장했을 때,
txt 파일에 문장 단위로 줄바꿈이 되어있는 경우와 (index 마다 문장 단위로 입력된 형태)
문단 단위로 줄바꿈 되어 있는 경우 (index 마다 하나의 article이 들어가 있는 형태)
혹은 전체 텍스트 데이터가 줄바꿈 없이 띄어쓰기로만 들어간 형태 .
중에 model.train() 의 입력 데이터로 더 적합한 형태가 있을지요 ?
초보라서.. 열심히 따라는 하는데 생각보다 결과가 잘 안나오네요 ㅜ.ㅜ
조언 주시면 감사하겠습니다 !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.