open-korean-text / elasticsearch-analysis-openkoreantext Goto Github PK
View Code? Open in Web Editor NEWKorean analysis plugin that integrates open-korean-text module into elasticsearch.
License: Apache License 2.0
Korean analysis plugin that integrates open-korean-text module into elasticsearch.
License: Apache License 2.0
When using this on elasticsearch 2.3.4 version, I m getting the below error for tokenizer query
PUT openkorean_sample/_settings
{
"settings": {
"index": {
"analysis": {
"analyzer": {
"my_icu_analyzer": {
"tokenizer": "openkoreantext-tokenizer"
}
}
}
}
}
}
POST /openkorean_sample/_analyze
{
"analyzer": "my_icu_analyzer",
"text" : "한국어를 처리하는 예시입니닼ㅋㅋ"
}
Error :
{
"error": {
"root_cause": [
{
"type": "no_shard_available_action_exception",
"reason": "No shard available for [org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest@164c06a8]"
}
],
"type": "no_shard_available_action_exception",
"reason": "No shard available for [org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest@164c06a8]"
},
"status": 503
}
readme에도 같은 오타가 있습니다.
그리고 커스텀 빌드할경우
/build/distributions 에 zip 파일을 사용하는게 맞는거죠?
I am using ES 6.7.0, Could you upgrade plugin versions?
Currently it's extremely difficult to include the plugin in a maven project.
Would you be able to publish this to maven repository in addition to github?
Currently we include other plugins published on maven in our project through this format:
open-korean-text:elasticssearch-analysis-openkoreantext:${elasticsearch.version}.2
Which bin/elasticsearch-plugin install will look at maven for.
{ "name": "dwkim02", "cluster_name": "elasticsearch", "cluster_uuid": "44NEWUJLRT-9EKGDLkh5pg", "version": { "number": "5.5.1", "build_hash": "19c13d0", "build_date": "2017-07-18T20:44:24.823Z", "build_snapshot": false, "lucene_version": "6.6.0" }, "tagline": "You Know, for Search" }
엘라스틱서치는 5.5.1 버전을 쓰고 있고 openkoreantext 2.1.0 버전입니다.
curl -X POST 'http://localhost:9200/_analyze' -d '{ "analyzer": "openkoreantext-analyzer", "text": "한국어를 처리하는 예시입니닼ㅋㅋ" }'
를 실행하여 테스트를 진행하면 다음과 같은 에러가 발생합니다...
어떤게 원인인지 알 수 있을까요?
[2017-08-04T17:42:26,857][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [dwkim02] fatal error in thread [elasticsearch[dwkim 02][index][T#2]], exiting java.lang.ExceptionInInitializerError: null at org.elasticsearch.index.analysis.OpenKoreanTextAnalyzerProvider.<init>(OpenKoreanTextAnalyzerProvider.java:16) ~[?:?] at org.elasticsearch.indices.analysis.AnalysisModule$AnalysisProvider.get(AnalysisModule.java:395) ~[elasticsearch-5.5.1.j ar:5.5.1] at org.elasticsearch.index.analysis.AnalysisRegistry.lambda$getAnalyzer$0(AnalysisRegistry.java:130) ~[elasticsearch-5.5.1 .jar:5.5.1] at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1660) ~[?:1.8.0_141] at org.elasticsearch.index.analysis.AnalysisRegistry.getAnalyzer(AnalysisRegistry.java:128) ~[elasticsearch-5.5.1.jar:5.5. 1] at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.analyze(TransportAnalyzeAction.java:169) ~[elasti csearch-5.5.1.jar:5.5.1] at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.shardOperation(TransportAnalyzeAction.java:157) ~ [elasticsearch-5.5.1.jar:5.5.1] at org.elasticsearch.action.admin.indices.analyze.TransportAnalyzeAction.shardOperation(TransportAnalyzeAction.java:77) ~[ elasticsearch-5.5.1.jar:5.5.1] at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$ShardTransportHandler.messageReceived(Transpor tSingleShardAction.java:294) ~[elasticsearch-5.5.1.jar:5.5.1] at org.elasticsearch.action.support.single.shard.TransportSingleShardAction$ShardTransportHandler.messageReceived(Transpor tSingleShardAction.java:287) ~[elasticsearch-5.5.1.jar:5.5.1] at org.elasticsearch.transport.TransportRequestHandler.messageReceived(TransportRequestHandler.java:33) ~[elasticsearch-5. 5.1.jar:5.5.1] at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:69) ~[elasticsear ch-5.5.1.jar:5.5.1] at org.elasticsearch.transport.TransportService$7.doRun(TransportService.java:644) ~[elasticsearch-5.5.1.jar:5.5.1] at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingAbstractRunnable.doRun(ThreadContext.java:638) ~[elasticsearch-5.5.1.jar:5.5.1] at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) ~[elasticsearch-5.5.1.jar:5.5.1 ] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[?:1.8.0_141] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[?:1.8.0_141] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_141] Caused by: java.security.AccessControlException: access denied ("java.io.FilePermission" "C:\Program%20Files\Elastic\Elasticsearch \plugins\elasticsearch-analysis-openkoreantext\dic" "read") at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) ~[?:1.8.0_141] at java.security.AccessController.checkPermission(AccessController.java:884) ~[?:1.8.0_141] at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) ~[?:1.8.0_141] at java.lang.SecurityManager.checkRead(SecurityManager.java:888) ~[?:1.8.0_141] at java.io.File.isDirectory(File.java:844) ~[?:1.8.0_141] at org.apache.lucene.analysis.ko.UserDictionaryLoader.<clinit>(UserDictionaryLoader.java:30) ~[?:?] ... 18 more
analyzer 테스트를 위해서 readme에 있는 내용대로 필터를 적용했습니다.
kibana에서 다음의 명령으로 테스트를 진행했습니다.
POST openpedia/_analyze
{
"char_filter" : ["openkoreantext-normalizer"],
"tokenizer": "openkoreantext-tokenizer",
"filter": [ "openkoreantext-stemmer", "openkoreantext-redundant-filter", "classic-filter", "length-filter", "lowcase" ],
"text":"아버지가방에들어가신다."
}
classic-filter, length-filer,lowcase를 찾을 수 없다고 나옵니다.
"classic", "length", "lowercase" 로 지정하니 동작합니다.
플러그인 내부에서 사용하는 필터명과 커스텀 분석기 적용시의 필터명이 다른가요?
es 5.6.5 용이 없네요. 요청 드립니다.
매 버전별로는 힘들더라도, 메이져 버젼업데이트에 따른 플러그인 공식 제공을 필요할것 같습니다.
7.x 버전 지원에 관하여 의견이 궁굼합니다
사용자 사전 sample-dictionary 파일에
단어를 추가 후
elasticsearch 를 재시작 하였으나
기존 인덱스에서 검색을 해보니
해당 단어 형태소 분석이 되지 않습니다.
기존 인덱스를 다시 인덱싱 하지 않고
추가한 단어 형태소 분석 적용하는 방법은 없는지요?
'descriptor' 에
'name': 'elasticserach-analysis-openkoreantext'
elasticsearch 인데 elasticserach로 되어 있네요.
그리고 5.4.1 버전대응은 build.gradle 의 버전명만 올려서 빌드 해서 사용하면 되는건가요?
@nlpenguin
open-korean-text/open-korean-text#18 에 문의 남긴것을 시작으로 첫 번째 버전 올렸습니다. 🎉
혹시 가능하시면 open-korean-text 기능들에 대해서 대략적으로 리뷰 한 번 부탁드릴께요. 2.0.1 버젼을 타겟으로 개발되었습니다.
user-dic에서 Noun외의 Verb같은 사전도 추가 가능 한지 궁금합니다
또한 색인시 Noun과 Verb과 같은 type을 구분하여 색인 가능 한지도 문의 드립니다.
open-korean-text-2.1.0.jar의 내부 util에 사전 파일을 바꿔도 업데이트가 안되는 것 같은데
내부 default 사전은 어느 사전을 사용하고 있는지 궁금합니다
디폴트 애널라이저로 설정하는 방법도 설명에 좀 추가해주세요.
curl -XPUT http://localhost:9200/my_index?pretty -d '{
"settings": {
"analysis": {
"analyzer": {
"default": {
"type": "custom",
"tokenizer": "openkoreantext-tokenizer",
"char_filter": "openkoreantext-normalizer",
"filter": [
"openkoreantext-stemmer",
"openkoreantext-redundant-filter",
"openkoreantext-phrase-extractor"
]
}
}
}
}
}'
이런 식으로 해야 하는 거 맞죠?
이렇게 해서,
curl -XGET http://localhost:9200/my_index/_analyze?pretty -d "한국어를 처리하는 예시입니닼ㅋㅋ"
=>
{
"tokens" : [
{
"token" : "한국어처리",
"start_offset" : 0,
"end_offset" : 5,
"type" : "Noun",
"position" : 0
},
{
"token" : "예시",
"start_offset" : 10,
"end_offset" : 12,
"type" : "Noun",
"position" : 1
},
{
"token" : "한국어",
"start_offset" : 0,
"end_offset" : 3,
"type" : "Noun",
"position" : 2
},
{
"token" : "처리",
"start_offset" : 5,
"end_offset" : 7,
"type" : "Noun",
"position" : 3
}
]
}
이렇게 나오는 건 확인했는데, 한참 헤맸습니다 ㅠㅠ
안녕하세요, open-korean-text를 사용하여 ES에 데이터 인덱싱을 하려고하는데,
array 형태의 데이터 입력시 offset 문제로 인덱싱이 되지 않아 질문 드립니다.
인덱싱 할 텍스트가
["동해물과 백두산이", "마르고 닳도록"]
위와 같은 형태일 경우
open-korean-text 사용시 생기는 토큰의 오프셋은 인덱스가 바뀔 때 마다 초기화가 되고,
ES에서 제공하는 기본 analyzer 사용시에는 array내의 모든 string이 순서대로 오프셋이 정해지는데요,
ES에 데이터를 인덱싱 할 경우 한 필드 내에서는 offest이 다시 뒤로가는 경우가 생기면 인덱싱이 되지 않으며 warning이 발생합니다.
이 이슈 수정 요청 드려도 될까요?
분석결과는 아래 참고 부탁드립니다.
open-korean-text 사용시
{
"tokens" : [
{
"token" : "동",
"start_offset" : 0,
"end_offset" : 1,
"type" : "Modifier",
"position" : 0
},
{
"token" : "해물",
"start_offset" : 1,
"end_offset" : 3,
"type" : "Noun",
"position" : 1
},
{
"token" : "백두산",
"start_offset" : 5,
"end_offset" : 8,
"type" : "Noun",
"position" : 2
},
{
"token" : "마르고",
"start_offset" : 1,
"end_offset" : 4,
"type" : "Noun",
"position" : 103
},
{
"token" : "닳다",
"start_offset" : 5,
"end_offset" : 8,
"type" : "Verb",
"position" : 104
}
]
}
ES에서 제공하는 기본 analyzer 사용시
{
"tokens" : [
{
"token" : "동해물과",
"start_offset" : 0,
"end_offset" : 4,
"type" : "<HANGUL>",
"position" : 0
},
{
"token" : "백두산이",
"start_offset" : 5,
"end_offset" : 9,
"type" : "<HANGUL>",
"position" : 1
},
{
"token" : "마르고",
"start_offset" : 10,
"end_offset" : 13,
"type" : "<HANGUL>",
"position" : 102
},
{
"token" : "닳도록",
"start_offset" : 14,
"end_offset" : 17,
"type" : "<HANGUL>",
"position" : 103
}
]
}
버전만 바꿔서 빌드 해보니 test에서 걸리네요.
뭔가 바뀐것이 있는듯 합니다.
아..그리고 open-korean-text 도 2.0.4로 버전이 올라갔네요 ^^
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.