Skip to content
Snippets Groups Projects
Commit 68d2bb04 authored by KimChiheon's avatar KimChiheon
Browse files

Update Example.md

parent 5d43d5ed
No related branches found
No related tags found
No related merge requests found
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
## 주의사항 ## 주의사항
- 사용을 원하는 python file과 동일한 폴더에 다운로드 후 import 하셔서 정상 실행이 됩니다. - 사용을 원하는 python file과 동일한 폴더에 다운로드 후 import 하셔서 정상 실행이 됩니다.
- Library file에 import를 하시는 경우 korea_nlp_library.py file을 Download 해주세요.
#### 예제 #### 예제
- 위 class 를 import 하여 사용하시면 됩니다. - 위 class 를 import 하여 사용하시면 됩니다.
...@@ -52,10 +51,10 @@ kn.tokenize(sentence,scores) ...@@ -52,10 +51,10 @@ kn.tokenize(sentence,scores)
<br> <br>
**input**: **input**:
<pre><code>import korea_nlp <pre><code>import korea_nlp
kn = korea_nlp.noun_extract() kn = korea_nlp.Tokenizer()
sentence = '김치헌은 바보다.' sentence = '김치헌은 바보다.'
scores = {} scores = {}
kn.tokenize(sentence,scores) kn.noun_extract(sentence,scores)
</code></pre> </code></pre>
<br> <br>
**output**: **output**:
...@@ -67,10 +66,10 @@ kn.tokenize(sentence,scores) ...@@ -67,10 +66,10 @@ kn.tokenize(sentence,scores)
<br> <br>
**input**: **input**:
<pre><code>import korea_nlp <pre><code>import korea_nlp
kn = korea_nlp.noun_extract() kn = korea_nlp.Tokenizer()
sentence = '김치헌은 바보다.' sentence = '김치헌은 바보다.'
scores = {'김치헌':1.0} scores = {'김치헌':1.0}
kn.tokenize(sentence,scores) kn.noun_extract(sentence,scores)
</code></pre> </code></pre>
<br> <br>
**output**: **output**:
...@@ -82,4 +81,37 @@ Score 값을 지정한 '김치헌'이라는 고유명사가 추출됨을 알 수 ...@@ -82,4 +81,37 @@ Score 값을 지정한 '김치헌'이라는 고유명사가 추출됨을 알 수
<br> <br>
특정 'Noun' 갯수 측정 특정 'Noun' 갯수 측정
- 추가예정 <br>
\ No newline at end of file
**input**:
<pre><code>import korea_nlp
kn = korea_nlp.Tokenizer()
sentence = '김치헌은 김치를 좋아한다.'
scores = {}
word = "김치"
kn.noun_counter(sentence,scores,word)
</code></pre>
<br>
**output**:
<pre><code> 2
</code></pre>
Score 값을 따로 지정해주지 않아서 default 로 지정된 library 자체 data를 기반으로 문장을 token화하여 '김치' 라는 단어의 갯수를 Counting 하여 '2'가 출력됩니다.
<br>
**input**:
<pre><code>import korea_nlp
kn = korea_nlp.Tokenizer()
sentence = '김치헌은 김치를 좋아한다.'
scores = {'김치헌':1.0}
word = "김치"
kn.noun_counter(sentence,scores,word)
</code></pre>
<br>
**output**:
<pre><code> 1
</code></pre>
Score에 '김치헌' 이라는 고유명사를 추출할 수 있도록 지정해주어 '김치' 라는 단어 counting 시 counting 되지 않습니다.
<br>
고유명사를 불필요하게 Counting 하는 경우를 배제합니다.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment