class_docstr: Implements the *Biased TextRank* algorithm described by
  [[kazemi-etal-2020-biased]](https://derwen.ai/docs/ptr/biblio/#kazemi-etal-2020-biased),
  deployed as a `spaCy` pipeline component.
  
  This class does not get called directly; instantiate its factory
  instead.
      
class_docstr_tok: ["Implements","the","*","Biased","TextRank","*","algorithm","described","by","[","[","kazemi-etal-2020-biased","]","]","(","https",":","\/\/derwen.ai\/docs\/ptr\/biblio\/","#","kazemi-etal-2020-biased",")",",","deployed","as","a","`","spaCy","`","pipeline","component",".","This","class","does","not","get","called","directly",";","instantiate","its","factory","instead","."]
docstr: Re-runs the *Biased TextRank* algorithm with the given focus.
  This approach allows an application to "change focus" without
  re-running the entire pipeline.
  
      focus:
  optional text (string) with space-delimited tokens to use for the *focus set*; defaults to `None`
  
      bias:
  optional bias for *node weight* values on tokens found within the *focus set*; defaults to `1.0`
  
      default_bias:
  optional bias for *node weight* values on tokens not found within the *focus set*; set to `0.0` to enhance the focus, especially in the case of long documents; defaults to `1.0`
  
      returns:
  list of ranked phrases, in descending order
          
docstr_tok: ["Re-runs","the","*","Biased","TextRank","*","algorithm","with","the","given","focus",".","This","approach","allows","an","application","to","``","change","focus","''","without","re-running","the","entire","pipeline",".","focus",":","optional","text","(","string",")","with","space-delimited","tokens","to","use","for","the","*","focus","set","*",";","defaults","to","`","None","`","bias",":","optional","bias","for","*","node","weight","*","values","on","tokens","found","within","the","*","focus","set","*",";","defaults","to","`","1.0","`","default_bias",":","optional","bias","for","*","node","weight","*","values","on","tokens","not","found","within","the","*","focus","set","*",";","set","to","`","0.0","`","to","enhance","the","focus",",","especially","in","the","case","of","long","documents",";","defaults","to","`","1.0","`","returns",":","list","of","ranked","phrases",",","in","descending","order"]
code: def change_focus(
      self,
      focus: str = None,
      bias: float = _DEFAULT_BIAS,
      default_bias: float = _DEFAULT_BIAS,
  ) -> typing.List[Phrase]:
      """
      Re-runs the *Biased TextRank* algorithm with the given focus.
      This approach allows an application to "change focus" without
      re-running the entire pipeline.
  
          focus:
      optional text (string) with space-delimited tokens to use for the *focus set*; defaults to `None`
  
          bias:
      optional bias for *node weight* values on tokens found within the *focus set*; defaults to `1.0`
  
          default_bias:
      optional bias for *node weight* values on tokens not found within the *focus set*; set to `0.0` to enhance the focus, especially in the case of long documents; defaults to `1.0`
  
          returns:
      list of ranked phrases, in descending order
      """
      # update the focus parameters
      if focus:
          self.focus_tokens = set(focus.lower().split(" "))
      else:
          self.focus_tokens = set()
  
      self.node_bias = bias
      self.default_bias = default_bias
  
      # update the textrank phrase extraction
      self.doc._.phrases = self.calc_textrank()
  
      return self.doc._.phrases
  
file_path: pytextrank/pytextrank/biasedrank.py
imports: import typing
  from spacy.tokens import Doc, Token
  from .base import BaseTextRankFactory, BaseTextRank, Lemma, Phrase
label_desc: Use image node_id 3 for calling the BiasedTextRank obj's underlying member method code with example usage: obj.change_focus(focus, bias, default_bias) and returns: self