Fairseq Integration APIs

vizseq.ipynb.fairseq_viz.*

VizSeq can directly import and analyze model predictions generated by fairseq-generate or fairseq-interactive in Jupyter Notebook. The APIs are almost the same as the normal Jupyter Notebook APIs.

view_stats()

Arguments

  • log_path: str: The path to fairseq-generate or fairseq-interactive log file.

view_scores()

Arguments

  • log_path: str: The path to fairseq-generate or fairseq-interactive log file.
  • metrics: List[str]: List of scorer IDs. Use available_scorers() to check all the available ones.

view_examples()

Arguments

  • log_path: str: The path to fairseq-generate or fairseq-interactive log file.
  • metrics: Optional[List[str]] = None: List of scorer IDs. Default to None. Use available_scorers() to check all the available ones.
  • query: str = '': The keyword(s) for example filtering. Default to ''.
  • page_sz: int = 10: Page size. Default to 10.
  • page_no: int = 1: Page number. Default to 1.
  • sorting: VizSeqSortingType = VizSeqSortingType.original
  • need_g_translate: bool = False: To show Google Translate results or not. Default to False.
  • disable_alignment: bool = False: Not to show source-reference and reference-hypothesis alignments for rendering speedup. Default to False.

view_n_grams()

Arguments

  • log_path: str: The path to fairseq-generate or fairseq-interactive log file.
  • k: int = 64: Number of n-grams to be shown. Default to 64.