o
    5ti                     @   s  d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm	Z	 ddlm
Z
 dd	lmZ ed
dd eddd eddd eddd edg dd eddd eddd eddd ejZdd  Zed!kred
 ed ed ee dS dS )"a+  Main routine to calculate ROUGE scores across text files.

Designed to replicate scores computed by the ROUGE perl implementation as
closely as possible.

Output is a text file in CSV format.

Sample usage:

rouge ---rouge_types=rouge1,rouge2,rougeL \
    --target_filepattern=*.targets \
    --prediction_fliepattern=*.decodes \
    --output_filename=scores.csv \
    --use_stemmer

Which is equivalent to calling the perl ROUGE script as:

ROUGE-1.5.5.pl -m -e ./data -n 2 -a /tmp/rouge/settings.xml

Where settings.xml provides target and decode text.
    )absolute_import)division)print_function)app)flags)io)rouge_scorer)scoringtarget_filepatternNzFiles containing target text.prediction_filepatternz!Files containing prediction text.output_filenamez8File in which to write calculated ROUGE scores as a CSV.	delimiter
zRecord delimiter  in files.rouge_types)rouge1rouge2rougeLz!List of ROUGE types to calculate.use_stemmerFz8Whether to use Porter stemmer to remove common suffixes.	aggregateTz'Write aggregates if this is set to Truesplit_summarieszUWhether to split references and candidates into sentences before computing RougeLsum.c                 C   s`   t | dkrtdtjtjtjtjd}tj	rt
 nd }tjtjtjtj||tjd d S )N   z Too many command-line arguments.)r   r   )r   )lenr   
UsageErrorr   RougeScorerFLAGSr   r   r   r   r	   BootstrapAggregatorr   compute_scores_and_write_to_csvr
   r   r   r   )argvscorer
aggregator r    E/home/ubuntu/.local/lib/python3.10/site-packages/rouge_score/rouge.pymainD   s    

r"   __main__)__doc__
__future__r   r   r   abslr   r   rouge_scorer   r   r	   DEFINE_stringDEFINE_listDEFINE_booleanr   r"   __name__mark_flag_as_requiredrunr    r    r    r!   <module>   sR   


