fairsenseai.analysis.bias.analyze_text_csv

analyze_text_csv(file, use_summarizer, output_filename='analysis_results.csv')[source]

Analyzes a CSV file containing multiple text entries for bias.

Parameters:
  • file (TextIO) – The input CSV file containing text data.

  • use_summarizer (bool) – Whether to use the summarizer to condense the response.

  • output_filename (Optional[str]) – The filename to save the analysis results.

Returns:

The HTML table containing results of batch analysis.

Return type:

str

Examples

>>> csv_file = open("data.csv", mode='r', newline='', encoding='utf-8')
>>> results_table_html = analyze_text_csv(csv_file, use_summarizer=True)