TF-IDF: Difference between revisions
From CS Wiki
(새 문서: 분류:인공지능 ;Term Frequency - Inverse Document Frequency == 예시 === === TF Score === * a new car, used car, car review ** TF Score를 통해 car가 중요한 단어라...) |
No edit summary |
||
Line 14: | Line 14: | ||
| new || 1/7 | | new || 1/7 | ||
|- | |- | ||
| car || 3/7 | | car || '''3/7''' | ||
|- | |- | ||
| used || 1/7 | | used || 1/7 | ||
Line 27: | Line 27: | ||
! 단어 !! TF Score | ! 단어 !! TF Score | ||
|- | |- | ||
| a || 2/8 | | a || '''2/8''' | ||
|- | |- | ||
| friend || 2/8 | | friend || '''2/8''' | ||
|- | |- | ||
| in || | | in || 1/8 | ||
|- | |- | ||
| need || 1/8 | | need || 1/8 |
Revision as of 08:27, 28 December 2019
- Term Frequency - Inverse Document Frequency
예시 =
TF Score
- a new car, used car, car review
- TF Score를 통해 car가 중요한 단어라는 것을 확인하였음
단어 | TF Score |
---|---|
a | 1/7 |
new | 1/7 |
car | 3/7 |
used | 1/7 |
review | 1/7 |
- a friend in need is a friend indeed
- TF Score를 측정했는데 Friend와 a가 동일한 중요도로 산출됨
- 이런 경우를 보완하기 위해 IDF 사용
단어 | TF Score |
---|---|
a | 2/8 |
friend | 2/8 |
in | 1/8 |
need | 1/8 |
is | 1/8 |
indeed | 1/8 |
IDF
- Log (이 단어가 사용된 문장의 수 / 총 문장의 수+1)
- TF에 IDF를 적용하면, a/the/in/is 와 같은 의미 없는 불용어를 희석시킬 수 있다.
단어 | TF Score | IDF Score | TF * IDF |
---|---|---|---|
a | 1/7 | Log(2/2) = 0 | 0 |
new | 1/7 | Log(2/1) = 0.3 | 0.04 |
car | 3/7 | Log(2/1) = 0.3 | 0.13 |
used | 1/7 | Log(2/1) = 0.3 | 0.04 |
review | 1/7 | Log(2/1) = 0.3 | 0.04 |
a | 2/8 | Log(2/2) = 0 | 0 |
friend | 2/8 | Log(2/1) = 0.3 | 0.08 |
in | 1/8 | Log(2/1) = 0.3 | 0.04 |
need | 1/8 | Log(2/1) = 0.3 | 0.04 |
is | 1/8 | Log(2/1) = 0.3 | 0.04 |
indeed | 1/8 | Log(2/1) = 0.3 | 0.04 |