class_docstr: Create a doc instance of text, obtain cleaned, readable text and
  metadata from this doc.
  
  Properties:
  raw: incoming, unedited text
  language: 2-letter code for the language of the text
  is_detected_language: is the language detected or specified beforehand
  is_reliable_language: is the language specified or was it reliably detected
  hint_language: language you expect your text to be
  _spacy_nlps: nested dictionary {lang: {model_id: model}} with loaded spacy language modules
docstr: Extract and rank key terms in the document by proxying to
  `textacy.keyterms`. Returns a list of (term, score) tuples. Depending
  on the ranking algorithm used, terms can consist of multiple words.
  
  Available rankers are TextRank (textrank), SingleRank (singlerank) and
  SGRank ('sgrank').
  
  >>> from pprint import pprint
  >>> from textpipe.doc import Doc
  >>> doc = Doc('Amsterdam is the awesome capital of the Netherlands.')
  >>> pprint(doc.extract_keyterms(n_terms=3))
  [('awesome capital', 0.2384595585785324),
   ('Netherlands', 0.1312376837867799),
   ('Amsterdam', 0.07452637881734389)]
  >>> pprint(doc.extract_keyterms(ranker='sgrank'))
  [('awesome capital', 0.5638711013322963),
   ('Netherlands', 0.22636566128805719),
   ('Amsterdam', 0.20976323737964653)]
  >>> pprint(doc.extract_keyterms(ranker='sgrank', ngrams=(1, )))
  [('Netherlands', 0.40349153868348353),
   ('capital', 0.29176091721189235),
   ('awesome', 0.18150539145949696),
   ('Amsterdam', 0.12324215264512725)]
docstr_tok: ["Extract","and","rank","key","terms","in","the","document","by","proxying","to","`","textacy.keyterms","`",".","Returns","a","list","of","(","term",",","score",")","tuples",".","Depending","on","the","ranking","algorithm","used",",","terms","can","consist","of","multiple","words",".","Available","rankers","are","TextRank","(","textrank",")",",","SingleRank","(","singlerank",")","and","SGRank","(","'sgrank","'",")",".",">",">",">","from","pprint","import","pprint",">",">",">","from","textpipe.doc","import","Doc",">",">",">","doc","=","Doc","(","'Amsterdam","is","the","awesome","capital","of","the","Netherlands",".","'",")",">",">",">","pprint","(","doc.extract_keyterms","(","n_terms=3",")",")","[","(","'awesome","capital","'",",","0.2384595585785324",")",",","(","'Netherlands","'",",","0.1312376837867799",")",",","(","'Amsterdam","'",",","0.07452637881734389",")","]",">",">",">","pprint","(","doc.extract_keyterms","(","ranker='sgrank","'",")",")","[","(","'awesome","capital","'",",","0.5638711013322963",")",",","(","'Netherlands","'",",","0.22636566128805719",")",",","(","'Amsterdam","'",",","0.20976323737964653",")","]",">",">",">","pprint","(","doc.extract_keyterms","(","ranker='sgrank","'",",","ngrams=","(","1",",",")",")",")","[","(","'Netherlands","'",",","0.40349153868348353",")",",","(","'capital","'",",","0.29176091721189235",")",",","(","'awesome","'",",","0.18150539145949696",")",",","(","'Amsterdam","'",",","0.12324215264512725",")","]"]
code: def extract_keyterms(self, ranker="textrank", n_terms=10, **kwargs):
      """
      Extract and rank key terms in the document by proxying to
      `textacy.keyterms`. Returns a list of (term, score) tuples. Depending
      on the ranking algorithm used, terms can consist of multiple words.
  
      Available rankers are TextRank (textrank), SingleRank (singlerank) and
      SGRank ('sgrank').
  
      >>> from pprint import pprint
      >>> from textpipe.doc import Doc
      >>> doc = Doc('Amsterdam is the awesome capital of the Netherlands.')
      >>> pprint(doc.extract_keyterms(n_terms=3))
      [('awesome capital', 0.2384595585785324),
       ('Netherlands', 0.1312376837867799),
       ('Amsterdam', 0.07452637881734389)]
      >>> pprint(doc.extract_keyterms(ranker='sgrank'))
      [('awesome capital', 0.5638711013322963),
       ('Netherlands', 0.22636566128805719),
       ('Amsterdam', 0.20976323737964653)]
      >>> pprint(doc.extract_keyterms(ranker='sgrank', ngrams=(1, )))
      [('Netherlands', 0.40349153868348353),
       ('capital', 0.29176091721189235),
       ('awesome', 0.18150539145949696),
       ('Amsterdam', 0.12324215264512725)]
      """
      if self.nwords < 1:
          return []
      rankers = ["textrank", "sgrank", "scake", "yake"]
      if ranker not in rankers:
          raise ValueError(
              f'ranker "{ranker}" not available; use one '
              f"of {rankers}"
          )
      ranking_fn = getattr(textacy.ke, ranker)
      return ranking_fn(self._spacy_doc, topn=n_terms, **kwargs)
  
imports: import functools
  import re
  import unicodedata
  from collections import Counter
  from urllib.parse import urlparse
  import cld2
  import numpy
  import spacy
  import spacy.matcher
  import textacy
  import textacy.ke
  import textacy.text_utils
  from bs4 import BeautifulSoup
  from datasketch import MinHash
  from gensim.models.keyedvectors import KeyedVectors
  from gensim.summarization.summarizer import summarize
  from textpipe.data.emoji import EMOJI_TO_UNICODE_NAME, EMOJI_TO_SENTIMENT
  from textpipe.wrappers import RedisKeyedVectors
  from textpipe.util import getattr_
label_desc: Use image node_id 21 for calling the Doc obj's underlying member method code with example usage: obj.extract_keyterms(ranker, n_terms) and returns: ranking_fn, list