title: I am having problems doing Word Sense Disambiguation in Python using Lesk algorithm
body: <p>I am new to Python and NLTK so please bear with me. I wish to find the sense of a word in the context of a sentence. I am using the Lesk WSD algorithm but it is giving different outputs every time I run it. I know that Lesk has some level of inaccuracy. But, I think a POS tag will increase accuracy. </p>
  
  <p>The Lesk algorithm takes a POS tag as an argument, but it takes 'n','s','v' as an input and not 'NN','VBP' or other POS tags which are outputted by the pos_tag() function. I would like to know how to tag words in the form of 'n','s','v', or if there is a method in which I can convert the 'NN','VBP' and other tags into 'n','s','v', so I can give them as an input to the lesk(context_sentence,word,pos_tag) function. </p>
  
  <p>I am calculating the sentiment score of every word using SentiWordNet afterwards. </p>
  
  <pre><code>    from nltk.wsd import lesk
      from nltk import word_tokenize
      import nltk, re, pprint
      from nltk.corpus import sentiwordnet as swn
  
      def word_sense():
  
          sent = word_tokenize("He should be happy.")
          word = "be"
          pos = "v"
          score = lesk(sent,word,pos)
          print(score)
          print (str(score),type(score))
          set1 = re.findall("'([^']*)'",str(score))[0]
          print (set1)
          bank = swn.senti_synset(str(set1))
          print (bank)
  
      word_sense()
  </code></pre>