Wednesday, March 11, 2020

[Deep Learning Versus Machine Learning] What is the wordnet? Better than RNN Deep Learning?

[machine learing tutorial] WordNet

Machine Learning versus Deep Learning

  • Hello. I'm DVM who is talking about Deep Learning versus Machine Learning
  • Today, I'm going to talk about Machine Learning about Natural Language Processing
In [1]:
from IPython.display import Image
Image('wordnet.png',height='400',width='400')
Out[1]:
  • Most of Nautral Language Processing is made by RNN Deep Learning
  • Because It is very powerful and accurate than normal machine learning
  • But,today will talk about machine learning which name is wordnet.
  • The advantage of word net is faster and more simple than deep learning.
  • So many people use word net find the keyword
What's the natural language processing
  • Natural language processing make computer understand the word
  • It have 3 types such as thesaurus, static method and estimated method.
  • Today i will talk about Thesaurus.

Let's download NLTK library

In [2]:
!pip install nltk
Requirement already satisfied: nltk in c:\users\ssdwin10pc\anaconda3\lib\site-packages (3.4.5)
Requirement already satisfied: six in c:\users\ssdwin10pc\anaconda3\lib\site-packages (from nltk) (1.12.0)
In [3]:
from nltk.corpus import wordnet

Let's Find synonym using wordnet.

There are 4 synonym of "AI"

In [4]:
wordnet.synsets('AI')
Out[4]:
[Synset('army_intelligence.n.01'),
 Synset('artificial_intelligence.n.01'),
 Synset('three-toed_sloth.n.01'),
 Synset('artificial_insemination.n.01')]

The word I want to talk about is "artificial intelligence"

In [5]:
_AI = wordnet.synset('artificial_intelligence.n.01')

Let's find the definition of "AI"

In [6]:
_AI.definition()
Out[6]:
'the branch of computer science that deal with writing computer programs that can solve problems creatively'

Let's see what is in AI Group!

In [7]:
_AI.lemma_names()
Out[7]:
['artificial_intelligence', 'AI']

Let's find parents and children relation ships

In [8]:
_AI.hypernym_paths()[0]
Out[8]:
[Synset('entity.n.01'),
 Synset('abstraction.n.06'),
 Synset('psychological_feature.n.01'),
 Synset('cognition.n.01'),
 Synset('content.n.05'),
 Synset('knowledge_domain.n.01'),
 Synset('discipline.n.01'),
 Synset('engineering.n.02'),
 Synset('computer_science.n.01'),
 Synset('artificial_intelligence.n.01')]

Let's calculate word similarity

In [9]:
_CS = wordnet.synset('computer_science.n.01')
_KD = wordnet.synset('knowledge_domain.n.01')
_EG = wordnet.synset('engineering.n.02')
In [10]:
_AI.path_similarity(_CS)
Out[10]:
0.5
In [11]:
_AI.path_similarity(_KD)
Out[11]:
0.2
In [12]:
_AI.path_similarity(_EG)
Out[12]:
0.3333333333333333

So computer science is best keyword

No comments:

Post a Comment