code: def max_similarity(context_sentence: str, ambiguous_word: str, option="path",
                     lemma=True, context_is_lemmatized=False, pos=None, best=True) -> "wn.Synset":
      
      ambiguous_word = lemmatize(ambiguous_word)
      # If ambiguous word not in WordNet return None
      if not wn.synsets(ambiguous_word):
          return None
      if context_is_lemmatized:
          context_sentence = word_tokenize(context_sentence)
      else:
          context_sentence = [lemmatize(w) for w in word_tokenize(context_sentence)]
      result = {}
      for i in wn.synsets(ambiguous_word, pos=pos):
          result[i] = 0
          for j in context_sentence:
              _result = [0]
              for k in wn.synsets(j):
                  _result.append(sim(i,k,option))
              result[i] += max(_result)
  
      if option in ["res","resnik"]: # lower score = more similar
          result = sorted([(v,k) for k,v in result.items()])
      else: # higher score = more similar
          result = sorted([(v,k) for k,v in result.items()],reverse=True)
  
      return result[0][1] if best else result
docs: Perform WSD by maximizing the sum of maximum similarity between possible
      synsets of all words in the context sentence and the possible synsets of the
      ambiguous words (see http://goo.gl/XMq2BI):
      {argmax}_{synset(a)}(\sum_{i}^{n}{{max}_{synset(i)}(sim(i,a))}
  
      :param context_sentence: String, a sentence.
      :param ambiguous_word: String, a single word.
      :return: If best, returns only the best Synset, else returns a dict.