WordNet - Natural Language Processing With Python and NLTK p.10

Поделиться
HTML-код
  • Опубликовано: 5 фев 2025
  • Part of the NLTK Corpora is WordNet. I wouldn't totally classify WordNet as a Corpora, if anything it is really a giant Lexicon, but, either way, it is super useful. With WordNet we can do things like look up words and their meaning according to their parts of speech, we can find synonyms, antonyms, and even examples of the word in use.
    Playlist link: • Natural Language Proce...
    sample code: pythonprogrammi...
    hkinsley.com
    / sentdex
    sentdex.com
    seaofbtc.com

Комментарии • 96

  • @Mike-qt4fr
    @Mike-qt4fr 6 лет назад

    I wrote my own wordnet about 3 to 4 years ago used an online synonym resource with python. It wasn't very successful as it had to pull from an online resource per every comparison, but I'm glad theres a great offline resource like this out there!

  • @Munkyspunx
    @Munkyspunx 7 лет назад +5

    Ah man, I love this video. Just what I need to start my thesis. Subbed and Liked.

  • @devangsrivastava6736
    @devangsrivastava6736 4 года назад

    You earn a like every time I wantch your videos

  • @Paytida
    @Paytida 6 лет назад

    This is the Best Lesson from the start, Continuing the next videos. Would be great if you can make video specific on NLG.

  • @ItsCarleaJean
    @ItsCarleaJean 3 года назад

    "A ship is more similar to a cactus than a cat. Makes total sense." 😆

  • @malikumarhassan1
    @malikumarhassan1 2 года назад

    very well explained video, thanks a lot for such content.

  • @beerandmath
    @beerandmath 5 лет назад +34

    Dear Diary, today I learned that a ship is more similar to a cactus than to a cat.

    • @CarsteneZ
      @CarsteneZ 3 месяца назад

      what about "cat" as in " catamaran (dual hulled boat) ?

  • @balajikadambi7550
    @balajikadambi7550 7 лет назад

    The way you explained help me understand quickly. Thanks.

  • @ahanadrall5661
    @ahanadrall5661 5 лет назад

    keep up the good work man. you help a lot. thanks.

  • @hugochiang6395
    @hugochiang6395 8 лет назад +6

    I'm a little bit confused here. After obtaining the synonym using wordnet.synset, why do we have to go into lemma and choose the first element of the lemma to obtain the word? It does not feel very intuitive. Can you please explain the structures obtained from using wordnet.synset? And also, why do we need to reference 0 when we are getting the antonym? We did not do that when we append the synonym list.

    • @bambooindark1
      @bambooindark1 8 лет назад

      Same here, I don't quite understand what is lemma() and name() object doing here. And what kind of data type of lemma() is? Is it an Array or something?

    • @YuelengWang
      @YuelengWang 7 лет назад +1

      l.antonyms() is a list with only 1 element.
      you can try l.antonyms()[1] and it will throw out an IndexError: list index out of range.
      I am not fully understood either. Just try to explain what I know. :-)

    • @luvsuneja
      @luvsuneja 6 лет назад

      Thank you, bhai.

    • @GelsYT
      @GelsYT 5 лет назад

      based on what I have searched, lemmas are kinda like synsets, so in my case im thinking like the lemmas are like synsets of the first element in our synsets. I don't know pelase correct me. That's just my understanding

  • @badrmansour4309
    @badrmansour4309 8 лет назад

    Hi,
    First, I would like to say thank you for this channel, really I love it.
    I did compare between two words total and amount and that is what I got as result
    Synset('sum.n.05') Synset('sum.n.01')
    0.181818181818
    I think it is not that accurate in some cases Coz Total and amount should have same meaning and the percentage should be high, where as I got this result
    Synset('sum.n.01') Synset('sum.n.01')
    1.0 when I compared the amount with sum

    • @83vbond
      @83vbond 4 года назад

      Shouldn't the comparison be between 'total.n.01' and 'amount.n.01' ? The above looks like it's comparing two different senses of sum with each other, which would have different meanings (like the meaning of 'bull' in regular English vs in the stock market, as was explained in one of the first videos of this series).

  • @shivamkashyap8656
    @shivamkashyap8656 6 лет назад

    This video was pretty brief, not boring and informative. - Thanks
    Further I had a question.
    What if my scenario is that I have to search fir key words.
    Say I have to look for key words like 'Sales Document' / 'Purchase Documents' in another document
    Now they can also be written as 'Sales should be documented' or 'company selling should be written in the text files'. (For Sales Document keyword) Is there an approach here or will I have to build something?

  • @paramdeepsingh1307
    @paramdeepsingh1307 7 лет назад +1

    Hello Sentdex,
    I have hospital reviews on which I have to do sentiment analysis. SO do you think I should have some kind healthcare corpora to analyse or I can use one the corporas shown in your videos if not could you help me with the approach that I should take. Thanks!!

  • @sadenb
    @sadenb 8 лет назад +5

    Can you do a video for SentiWordnet>??

  • @jeremyheng8573
    @jeremyheng8573 3 года назад

    thank you for this tutorial!

  • @geanbaila1161
    @geanbaila1161 4 года назад

    No sé como llegué aquí pero estuvo muy interesante, muchas gracias

  • @mayureshvirkar8337
    @mayureshvirkar8337 6 лет назад

    Can I add words or synsets of my own to wordnet? Is there any way to edit or customize wordnet adjsting as per our requirements?

  • @asneogy
    @asneogy 8 лет назад

    I did not get the concept of lemmas as used in the context here. what does it essentially mean? That portion has a rather non intuitive syntax which I had to copy carefully - not something thats easy to figure out yourself.
    Further, is it possible to compare similarity between blocks of text: like one sentence / paragraph against another?

  • @Keertana97
    @Keertana97 7 лет назад

    Hey.. I have gained a lot of knowledge from your python, machine learning and natural language text processing videos..Thank you..We are doing a project on building ontology for knowledge oriented search engine. In this process, we have taken a text document, applied POS tagging to it and have applied topic modeling lda method to obtain concepts. We need to extract relationships between these concepts. We are stuck! Don't know how to do! It would be great if you could help us on this..Thanks

  • @rohankhilnani
    @rohankhilnani 6 лет назад

    I have a question. Why did we use [0] in "antonyms.append(l.antonyms()[0].name())" ? Does that mean we're only taking the first element of the antonyms list?

  • @piyushrumao4588
    @piyushrumao4588 7 лет назад

    Great video sir.
    Can I use wordnet and python to carry out Word Sense Induction, if so is it possible for you to post a video on it?

  • @georgewang7770
    @georgewang7770 7 лет назад

    Is there a way to show how the database came to decide ship is closer to cactus than cat?

  • @thisiscrispin
    @thisiscrispin 6 лет назад

    How can I search for a "word" which is made up of two words. e.g. "steering wheel"?
    It is listed on its own in the online website for wordnet but leaving a space between the two words when querying it causes an error.
    Thanks! :)

  • @rebumaregasa5661
    @rebumaregasa5661 6 лет назад

    Thank you very much. My question is: how we use wordnet to disambiguate words

  • @kaushikrk7434
    @kaushikrk7434 7 лет назад

    Hey buddy, like the comparing of words, can I compare sentences and get the similarity percentage ??

  • @MALLIPEDDIAKSHAY
    @MALLIPEDDIAKSHAY 8 лет назад +1

    How can I use my data set containing 30,000 product names and cluster them into groups based on similarites based on their product names. Example I would group "pepsi" and "pepsi plus" into one group.

  • @isaacmonterrosa4657
    @isaacmonterrosa4657 2 года назад

    I need help.What should i type in python to import arabic wordnet?

  • @mega6699
    @mega6699 9 лет назад +5

    This lecture was difficult to understand from the point of view of syntax of Python constructions, I had to watch it several times. Comments explaining what is our goal in each case would facilite understanding.

    • @bambooindark1
      @bambooindark1 8 лет назад +1

      Agree, I kind of confused about the data type those object / method output.
      For example, lemma()

    • @EarlLewis
      @EarlLewis 3 года назад

      If you didn't watch the whole series it could certainly be confusing. But if you had it's the same approach used in all 9 previous videos.

  • @ezequiasrocha3037
    @ezequiasrocha3037 5 лет назад +1

    Really nice video man. Could you give me some insight of how choose best words for make my image ML consider? I am doing it with my base of followers instagram feed photos?
    As I need make my training first I must consider with groups I must train before take a look on all this photos.
    I know I could make this with comments but I would like to consider the real post first. I think it's more relevant. Could you help me with that?

  • @dinnusebastian4615
    @dinnusebastian4615 5 лет назад

    sir,,,I am a beginner in nltk. can you tell me what is the difference between synsets and lemmas.

  • @mini-medevelopment310
    @mini-medevelopment310 8 лет назад

    Is there a way that we might obtain a more accurate understanding of the meaning by looking at the word in the context of the text? If so, how would we go about implementing that?

  • @Siddhiaugust
    @Siddhiaugust 7 лет назад

    Thanks a lot for your videos.. it is really helpful to me... Just I want to know that How Similarity, Synonyms & antonyms will be helpful in my classification model? I am unable to figure out uses of it...

  • @simonchan2394
    @simonchan2394 7 лет назад

    Hi Harrison. Thanks for the video. I was wondering if there is a way I can change the structure of the sentence with nltk? So instead of saying: "Peter kissed Sarah", you could say "Sarah kissed Peter". I understand that people use nltk to change words to substitute synonyms in place of existing words based on the wup_similarity score but overall the text should remind fairly the same unless nltk can be used to change the structure of the sentences hence I fail to see how people can use it to automatically change an essay / news article and make it totally dissimilar to the one that has already been written.

    • @Peter-bg1ku
      @Peter-bg1ku Год назад

      What if you do pos tagging and swap the two proper nouns around?

  • @myWorldDiscover
    @myWorldDiscover 9 лет назад

    Great, just a question could you please provide some examples about sentence similarity.

  • @ezequiasrocha3037
    @ezequiasrocha3037 5 лет назад

    Could you show how to retrieve hierarchy (ancestors and children) of a word (I guess this is hypernym). Thank you for the video.

  • @aseemahir
    @aseemahir 9 лет назад +1

    +sentdex Your videos are awesome! I'm especially amazed that you make such complex concepts and such difficult steps so easy to understand and try
    I had a question,
    In the wup_similarity function, what does the number stand for? For instance, in "ship.n.01" what does 01 stand for? Does it mean all the meanings? Or is it only pointing to a particular meaning? And if it points to a particular meaning, how do I determine which meaning do I use in the statement?

  • @maxbasilone3026
    @maxbasilone3026 3 года назад

    "Computers will read a few articles and switch words arounf and post an article and claim it as their own"
    Humans already did this, it's called journalism.

  • @yuriygrinchenko5889
    @yuriygrinchenko5889 8 лет назад

    Could you make a video utilizing the TIMIT database to train an LSTM neural network to do voice to text?

  • @AkhilKumar-nm2xz
    @AkhilKumar-nm2xz 8 лет назад

    How do I find out the semantic orientation of an adjective i.e. whether the adjective is positive , negative or neutral using NLTK.

  • @revathyramanujam5688
    @revathyramanujam5688 9 лет назад

    is it possible to add new words into wordnet? can u show a demo on that

    • @sentdex
      @sentdex  9 лет назад

      +Revathy Ramanujam You'd probably need to make your own local copy and add there, never needed to do that, so never tried.

  • @aakashkag5239
    @aakashkag5239 9 лет назад +1

    thanku you so muchhhh !...............excellent explanation

    • @sentdex
      @sentdex  9 лет назад +3

      +aakash kag Awesome, happy to share!

    • @jayjay5182
      @jayjay5182 8 лет назад

      +sentdex Hi ,
      Thank you for valuable knowledge . I am using it from India :). I would need to know if I can use this for accessing hypernyms if yes how. Please assist.

    • @jayjay5182
      @jayjay5182 8 лет назад

      +sentdex Hi ,
      Thank you for valuable knowledge . I am using it from India :). I would need to know if I can use this for accessing hypernyms if yes how. Please assist.

  • @user-oh4vm2kv5r
    @user-oh4vm2kv5r 9 лет назад

    how can I get all the verbs from brown corpus ?

  • @gurucharanpathalla5197
    @gurucharanpathalla5197 5 лет назад +1

    You are awesome!! great stuff there man!! Thanks a lot!!! :)

  • @shreyaskrishna6038
    @shreyaskrishna6038 2 года назад

    not clear with what exactly lemmas are?

  • @MohakNarang07
    @MohakNarang07 6 лет назад +1

    Love your tutorials!
    Can you please make a news bot kind of a thing sometime? It would be really cool!
    Thanks for all these awesome videos!

  • @kremilekish
    @kremilekish 9 лет назад

    How exactly is word similarity calculated? Incidentaly, I compared ship/kitten (to see the difference between kitten/cat) and I got the exactly same number (0.38095238095238093) as you did for cactus

  • @ryansajid5676
    @ryansajid5676 5 лет назад

    wordnet not working on my python 3.7.2 idle same for lemmatization

  • @matinebrahimkhani8038
    @matinebrahimkhani8038 5 лет назад

    it was great thank you

  • @doropomegranate
    @doropomegranate 8 лет назад

    If you try, you can do a good impression of chris griffin. btw, loving your tutorials. many thanks.

  • @vinicioschmidt4571
    @vinicioschmidt4571 5 лет назад +1

    Quem acompanha do Brasil (ou precisa desenvolver em Português) existe a wordnetPT (wordnet.pt/),. É necessário baixar o arquivo sql, executar para obter um banco de dados e criar as funções para extrair as informações. Obviamente, ela é de grande ajuda.

  • @trench6118
    @trench6118 9 лет назад +13

    Love your videos but watching you use idle instead of jupyter notebook gives me the same feeling as when my best friend doesn't like my favorite movie. Like how could you not love what I love?
    For real though, don't you find it easier to insert new cells and run portions of code at a time compared to commenting out stuff and running the whole script?

    • @sentdex
      @sentdex  9 лет назад +6

      +Lance Dacey I've tried to put my finger on what's up. Maybe I am broken, who knows. I think it is in part an objective and end-result in mind. Many people use these modules to "tinker" with the data to do research/analysis for themselves or at least fundamentally add value personally to their analysis. I use these modules with programs and websites that just simply run the code, unlike what IPython will do and very much like a general interpreter would do.
      Still though, one could argue that IPython would make the initial development time faster, and one might be right. I've wanted to like and use IPython for years now. I keep trying, and maybe one day.

    • @josephfondleberg9187
      @josephfondleberg9187 5 лет назад

      @@sentdex fast forward three years: I started using Jupyter Lab because of your Pandas tutorial series and am hooked

  • @abishekmahaseth1471
    @abishekmahaseth1471 5 лет назад

    To clarify, he is using the word "good" as "good" not "good"

  • @mandarkakade373
    @mandarkakade373 8 лет назад

    AWESOME!!!

  • @fruitblaster8930
    @fruitblaster8930 6 лет назад

    can someone explain the difference between lemmas and synset?
    I mean wrt to the 'syns[0].lemma()[0].name()'

  • @xihuang1891
    @xihuang1891 7 лет назад

    Would you say the word-net is a real dictionary just like human learns English?

  • @alancerocool
    @alancerocool 8 лет назад

    Hi, there is wordnet for Spanish? Thanks you! I love this channel!

    • @sentdex
      @sentdex  8 лет назад +1

      I am not sure, could try googling that if you haven't.

  • @Drithin69
    @Drithin69 9 лет назад

    How about Hypernyms/Hyponyms?

  • @amaragenetu4116
    @amaragenetu4116 4 года назад

    please add more codes in wsd

  • @nguyenvan-hau9577
    @nguyenvan-hau9577 8 лет назад +1

    I am being confused between line 1 and line 3 as follows. Because synonyums and antonums are completely exclusive:
    ------
    1. for l in syn.lemmas():
    2. synonyms.append(l.name())
    3. if l.antonyms():
    ------
    Is there anyone who can give me an explain?
    Many thanks.

    • @mohitkumar_aka_minto
      @mohitkumar_aka_minto 7 лет назад +1

      Lemmas in nltk have different methods .
      w = wordnet.synset("good.n.01").lemmas()[0]
      print(w.__doc__)
      Lemma methods:
      Lemmas have the following methods for retrieving related Lemmas. They
      correspond to the names for the pointer symbols defined here:
      wordnet.princeton.edu/man/wninput.5WN.html#sect3
      These methods all return lists of Lemmas:
      - antonyms
      - hypernyms, instance_hypernyms
      - hyponyms, instance_hyponyms
      - member_holonyms, substance_holonyms, part_holonyms
      - member_meronyms, substance_meronyms, part_meronyms
      - topic_domains, region_domains, usage_domains
      - attributes
      - derivationally_related_forms
      - entailments
      - causes
      - also_sees
      - verb_groups
      - similar_tos
      - pertainyms

    • @Dr_Ali.Aljboury
      @Dr_Ali.Aljboury 7 лет назад

      yup , me too also

  • @pratibhabajpai377
    @pratibhabajpai377 6 лет назад

    very informative video. Can you or any one let me know how to access Hindi WordNet in python.

  • @Mireda-wr3yc
    @Mireda-wr3yc 9 лет назад

    can you make a tutorial about how to install NLTK wordnet in python ! ! ?

    • @sentdex
      @sentdex  9 лет назад +2

      +Reda Ayala install nltk, then do nltk.download, and it's one of the options. If you just install everything, you will have wordnet installed.

    • @Mireda-wr3yc
      @Mireda-wr3yc 9 лет назад

      thank you , i checked only wordnet and it's working , thnx for help ))

  • @arjunkrishna8873
    @arjunkrishna8873 7 лет назад

    what is difference between lemmas and synset?

    • @arjunkrishna8873
      @arjunkrishna8873 7 лет назад +1

      as far as my understandind synset contains list of possible meaning of a given word
      and each element in a synset has different lemmas each lemma being a list of words with same meaning

  • @mohamedkhaled-uj7rf
    @mohamedkhaled-uj7rf 4 года назад

    I've tried to compare "good" with "bad" i have got surprised result 0.6666666666666666 which is not good any clarification !!

  • @Dr_Ali.Aljboury
    @Dr_Ali.Aljboury 7 лет назад

    I need connect with you if you don't mind please

  • @adriangg9018
    @adriangg9018 3 года назад

    I forgot the drink some coffee step and didnt manage to achieve shit after that point

  • @sambithdas921
    @sambithdas921 7 лет назад

    wup_similarity is throwing error

  • @S3b1Videos
    @S3b1Videos 6 лет назад

    3 cats make a ship!

  • @21akarsh
    @21akarsh 6 лет назад

    why "nice" and "good" has only 11% similarity??

  • @herp_derpingson
    @herp_derpingson 9 лет назад

    I created a NLTK gist which replaces all words in the string with their synonyms.
    gist.github.com/Ghost---Shadow/c361f2d6b4501f40648b
    I tried a lot of things to make it reliable but it still mostly prints nonsense. What should I do?

  • @nextgenfootball69420
    @nextgenfootball69420 6 лет назад

    lol ship and cat are 32% similar, i can't think of a single way they're similar

    • @sentdex
      @sentdex  6 лет назад

      They can often have similar colors. :D

    • @nextgenfootball69420
      @nextgenfootball69420 6 лет назад

      @@sentdex true dat, i guess the similarity algorithm is pretty genius!

  • @ritambasu9410
    @ritambasu9410 4 года назад

    Why do you give so much of add , i don't see anyother youtuber to give so much add , this tutorial is not worth much