"""simple docstring"""




import re
import string
from collections import Counter

import sacrebleu
import sacremoses
from packaging import version

import datasets


__lowerCamelCase											=  "\n@inproceedings{xu-etal-2016-optimizing,\n    title = {Optimizing Statistical Machine Translation for Text Simplification},\n    authors={Xu, Wei and Napoles, Courtney and Pavlick, Ellie and Chen, Quanze and Callison-Burch, Chris},\n    journal = {Transactions of the Association for Computational Linguistics},\n    volume = {4},\n    year={2016},\n    url = {https://www.aclweb.org/anthology/Q16-1029},\n    pages = {401--415\n},\n@inproceedings{post-2018-call,\n    title = \"A Call for Clarity in Reporting {BLEU} Scores\",\n    author = \"Post, Matt\",\n    booktitle = \"Proceedings of the Third Conference on Machine Translation: Research Papers\",\n    month = oct,\n    year = \"2018\",\n    address = \"Belgium, Brussels\",\n    publisher = \"Association for Computational Linguistics\",\n    url = \"https://www.aclweb.org/anthology/W18-6319\",\n    pages = \"186--191\",\n}\n"

__lowerCamelCase											=  "\\nWIKI_SPLIT is the combination of three metrics SARI, EXACT and SACREBLEU\nIt can be used to evaluate the quality of machine-generated texts.\n"


__lowerCamelCase											=  "\nCalculates sari score (between 0 and 100) given a list of source and predicted\nsentences, and a list of lists of reference sentences. It also computes the BLEU score as well as the exact match score.\nArgs:\n    sources: list of source sentences where each sentence should be a string.\n    predictions: list of predicted sentences where each sentence should be a string.\n    references: list of lists of reference sentences where each sentence should be a string.\nReturns:\n    sari: sari score\n    sacrebleu: sacrebleu score\n    exact: exact score\n\nExamples:\n    >>> sources=[\"About 95 species are currently accepted .\"]\n    >>> predictions=[\"About 95 you now get in .\"]\n    >>> references=[[\"About 95 species are currently known .\"]]\n    >>> wiki_split = datasets.load_metric(\"wiki_split\")\n    >>> results = wiki_split.compute(sources=sources, predictions=predictions, references=references)\n    >>> print(results)\n    {'sari': 21.805555555555557, 'sacrebleu': 14.535768424205482, 'exact': 0.0}\n"






def   UpperCAmelCase					(	UpperCamelCase__				):






							"""simple docstring"""





							def remove_articles(UpperCamelCase__				):
														A__	     =							re.compile(r'\b(a|an|the)\b'       ,    re.UNICODE				)
														return re.sub(UpperCamelCase__       ,    ' '       ,    UpperCamelCase__				)

							def white_space_fix(UpperCamelCase__				):
														return " ".join(text.split()				)

							def remove_punc(UpperCamelCase__				):
														A__	     =							set(string.punctuation				)
														return "".join(ch for ch in text if ch not in exclude				)

							def lower(UpperCamelCase__				):
														return text.lower()

							return white_space_fix(remove_articles(remove_punc(lower(UpperCamelCase__				)				)				)				)






def   UpperCAmelCase					(	UpperCamelCase__       ,    UpperCamelCase__				):






							"""simple docstring"""





							return int(normalize_answer(UpperCamelCase__				) == normalize_answer(UpperCamelCase__				)				)






def   UpperCAmelCase					(	UpperCamelCase__       ,    UpperCamelCase__				):






							"""simple docstring"""





							A__	     =							[any(compute_exact(UpperCamelCase__       ,    UpperCamelCase__				) for ref in refs				) for pred, refs in zip(UpperCamelCase__       ,    UpperCamelCase__				)]
							return (sum(UpperCamelCase__				) / len(UpperCamelCase__				)) * 100






def   UpperCAmelCase					(	UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__				):






							"""simple docstring"""





							A__	     =							[rgram for rgrams in rgramslist for rgram in rgrams]
							A__	     =							Counter(UpperCamelCase__				)

							A__	     =							Counter(UpperCamelCase__				)
							A__	     =							Counter()
							for sgram, scount in sgramcounter.items():
														A__	     =							scount * numref

							A__	     =							Counter(UpperCamelCase__				)
							A__	     =							Counter()
							for cgram, ccount in cgramcounter.items():
														A__	     =							ccount * numref

							# KEEP
							A__	     =							sgramcounter_rep & cgramcounter_rep
							A__	     =							keepgramcounter_rep & rgramcounter
							A__	     =							sgramcounter_rep & rgramcounter

							A__	     =							0
							A__	     =							0
							for keepgram in keepgramcountergood_rep:
														keeptmpscorea += keepgramcountergood_rep[keepgram] / keepgramcounter_rep[keepgram]
														# Fix an alleged bug [2] in the keep score computation.
														# keeptmpscore2 += keepgramcountergood_rep[keepgram] / keepgramcounterall_rep[keepgram]
														keeptmpscorea += keepgramcountergood_rep[keepgram]
							# Define 0/0=1 instead of 0 to give higher scores for predictions that match
							#      a target exactly.
							A__	     =							1
							A__	     =							1
							if len(UpperCamelCase__				) > 0:
														A__	     =							keeptmpscorea / len(UpperCamelCase__				)
							if len(UpperCamelCase__				) > 0:
														# Fix an alleged bug [2] in the keep score computation.
														# keepscore_recall = keeptmpscore2 / len(keepgramcounterall_rep)
														A__	     =							keeptmpscorea / sum(keepgramcounterall_rep.values()				)
							A__	     =							0
							if keepscore_precision > 0 or keepscore_recall > 0:
														A__	     =							2 * keepscore_precision * keepscore_recall / (keepscore_precision + keepscore_recall)

							# DELETION
							A__	     =							sgramcounter_rep - cgramcounter_rep
							A__	     =							delgramcounter_rep - rgramcounter
							A__	     =							sgramcounter_rep - rgramcounter
							A__	     =							0
							A__	     =							0
							for delgram in delgramcountergood_rep:
														deltmpscorea += delgramcountergood_rep[delgram] / delgramcounter_rep[delgram]
														deltmpscorea += delgramcountergood_rep[delgram] / delgramcounterall_rep[delgram]
							# Define 0/0=1 instead of 0 to give higher scores for predictions that match
							# a target exactly.
							A__	     =							1
							if len(UpperCamelCase__				) > 0:
														A__	     =							deltmpscorea / len(UpperCamelCase__				)

							# ADDITION
							A__	     =							set(UpperCamelCase__				) - set(UpperCamelCase__				)
							A__	     =							set(UpperCamelCase__				) & set(UpperCamelCase__				)
							A__	     =							set(UpperCamelCase__				) - set(UpperCamelCase__				)

							A__	     =							0
							for addgram in addgramcountergood:
														addtmpscore += 1

							# Define 0/0=1 instead of 0 to give higher scores for predictions that match
							# a target exactly.
							A__	     =							1
							A__	     =							1
							if len(UpperCamelCase__				) > 0:
														A__	     =							addtmpscore / len(UpperCamelCase__				)
							if len(UpperCamelCase__				) > 0:
														A__	     =							addtmpscore / len(UpperCamelCase__				)
							A__	     =							0
							if addscore_precision > 0 or addscore_recall > 0:
														A__	     =							2 * addscore_precision * addscore_recall / (addscore_precision + addscore_recall)

							return (keepscore, delscore_precision, addscore)






def   UpperCAmelCase					(	UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__				):






							"""simple docstring"""





							A__	     =							len(UpperCamelCase__				)

							A__	     =							ssent.split(' '				)
							A__	     =							csent.split(' '				)
							A__	     =							[]
							A__	     =							[]
							A__	     =							[]
							A__	     =							[]
							A__	     =							[]
							A__	     =							[]

							A__	     =							[]
							A__	     =							[]
							A__	     =							[]
							A__	     =							[]
							for rsent in rsents:
														A__	     =							rsent.split(' '				)
														A__	     =							[]
														A__	     =							[]
														A__	     =							[]
														ragramslist.append(UpperCamelCase__				)
														for i in range(0       ,    len(UpperCamelCase__				) - 1				):
																					if i < len(UpperCamelCase__				) - 1:
																												A__	     =							ragrams[i] + ' ' + ragrams[i + 1]
																												ragrams.append(UpperCamelCase__				)
																					if i < len(UpperCamelCase__				) - 2:
																												A__	     =							ragrams[i] + ' ' + ragrams[i + 1] + ' ' + ragrams[i + 2]
																												ragrams.append(UpperCamelCase__				)
																					if i < len(UpperCamelCase__				) - 3:
																												A__	     =							ragrams[i] + ' ' + ragrams[i + 1] + ' ' + ragrams[i + 2] + ' ' + ragrams[i + 3]
																												ragrams.append(UpperCamelCase__				)
														ragramslist.append(UpperCamelCase__				)
														ragramslist.append(UpperCamelCase__				)
														ragramslist.append(UpperCamelCase__				)

							for i in range(0       ,    len(UpperCamelCase__				) - 1				):
														if i < len(UpperCamelCase__				) - 1:
																					A__	     =							sagrams[i] + ' ' + sagrams[i + 1]
																					sagrams.append(UpperCamelCase__				)
														if i < len(UpperCamelCase__				) - 2:
																					A__	     =							sagrams[i] + ' ' + sagrams[i + 1] + ' ' + sagrams[i + 2]
																					sagrams.append(UpperCamelCase__				)
														if i < len(UpperCamelCase__				) - 3:
																					A__	     =							sagrams[i] + ' ' + sagrams[i + 1] + ' ' + sagrams[i + 2] + ' ' + sagrams[i + 3]
																					sagrams.append(UpperCamelCase__				)

							for i in range(0       ,    len(UpperCamelCase__				) - 1				):
														if i < len(UpperCamelCase__				) - 1:
																					A__	     =							cagrams[i] + ' ' + cagrams[i + 1]
																					cagrams.append(UpperCamelCase__				)
														if i < len(UpperCamelCase__				) - 2:
																					A__	     =							cagrams[i] + ' ' + cagrams[i + 1] + ' ' + cagrams[i + 2]
																					cagrams.append(UpperCamelCase__				)
														if i < len(UpperCamelCase__				) - 3:
																					A__	     =							cagrams[i] + ' ' + cagrams[i + 1] + ' ' + cagrams[i + 2] + ' ' + cagrams[i + 3]
																					cagrams.append(UpperCamelCase__				)

							((A__)     ,  (A__)     ,  (A__))	     =							SARIngram(UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__				)
							((A__)     ,  (A__)     ,  (A__))	     =							SARIngram(UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__				)
							((A__)     ,  (A__)     ,  (A__))	     =							SARIngram(UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__				)
							((A__)     ,  (A__)     ,  (A__))	     =							SARIngram(UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__				)
							A__	     =							sum([keepascore, keepascore, keepascore, keepascore]				) / 4
							A__	     =							sum([delascore, delascore, delascore, delascore]				) / 4
							A__	     =							sum([addascore, addascore, addascore, addascore]				) / 4
							A__	     =							(avgkeepscore + avgdelscore + avgaddscore) / 3
							return finalscore






def   UpperCAmelCase					(	UpperCamelCase__       ,    UpperCamelCase__ = True       ,    UpperCamelCase__ = "13a"       ,    UpperCamelCase__ = True				):






							"""simple docstring"""





							if lowercase:
														A__	     =							sentence.lower()

							if tokenizer in ["13a", "intl"]:
														if version.parse(sacrebleu.__version__				).major >= 2:
																					A__	     =							sacrebleu.metrics.bleu._get_tokenizer(UpperCamelCase__				)()(UpperCamelCase__				)
														else:
																					A__	     =							sacrebleu.TOKENIZERS[tokenizer]()(UpperCamelCase__				)
							elif tokenizer == "moses":
														A__	     =							sacremoses.MosesTokenizer().tokenize(UpperCamelCase__       ,    return_str=UpperCamelCase__       ,    escape=UpperCamelCase__				)
							elif tokenizer == "penn":
														A__	     =							sacremoses.MosesTokenizer().penn_tokenize(UpperCamelCase__       ,    return_str=UpperCamelCase__				)
							else:
														A__	     =							sentence

							if not return_str:
														A__	     =							normalized_sent.split()

							return normalized_sent






def   UpperCAmelCase					(	UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__				):






							"""simple docstring"""





							if not (len(UpperCamelCase__				) == len(UpperCamelCase__				) == len(UpperCamelCase__				)):
														raise ValueError('Sources length must match predictions and references lengths.'				)
							A__	     =							0
							for src, pred, refs in zip(UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__				):
														sari_score += SARIsent(normalize(UpperCamelCase__				)       ,    normalize(UpperCamelCase__				)       ,    [normalize(UpperCamelCase__				) for sent in refs]				)
							A__	     =							sari_score / len(UpperCamelCase__				)
							return 100 * sari_score






def   UpperCAmelCase					(	UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__="exp"       ,    UpperCamelCase__=None       ,    UpperCamelCase__=False       ,    UpperCamelCase__=False       ,    UpperCamelCase__=False       ,    ):






							"""simple docstring"""





							A__	     =							len(references[0]				)
							if any(len(UpperCamelCase__				) != references_per_prediction for refs in references				):
														raise ValueError('Sacrebleu requires the same number of references for each prediction'				)
							A__	     =							[[refs[i] for refs in references] for i in range(UpperCamelCase__				)]
							A__	     =							sacrebleu.corpus_bleu(
							    UpperCamelCase__       ,    UpperCamelCase__       ,    smooth_method=UpperCamelCase__       ,    smooth_value=UpperCamelCase__       ,    force=UpperCamelCase__       ,    lowercase=UpperCamelCase__       ,    use_effective_order=UpperCamelCase__       ,    )
							return output.score


@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION		,						_KWARGS_DESCRIPTION )
class     UpperCamelCase__(			datasets.Metric ):





						def 				snake_case__	(       self     )					->				str:
													return datasets.MetricInfo(
													    description=_DESCRIPTION		,citation=_CITATION		,inputs_description=_KWARGS_DESCRIPTION		,features=datasets.Features(
													        {
													            'predictions': datasets.Value('string'		,id='sequence'     ),
													            'references': datasets.Sequence(datasets.Value('string'		,id='sequence'     )		,id='references'     ),
													        }     )		,codebase_urls=[
													        'https://github.com/huggingface/transformers/blob/master/src/transformers/data/metrics/squad_metrics.py',
													        'https://github.com/cocoxu/simplification/blob/master/SARI.py',
													        'https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/utils/sari_hook.py',
													        'https://github.com/mjpost/sacreBLEU',
													    ]		,reference_urls=[
													        'https://www.aclweb.org/anthology/Q16-1029.pdf',
													        'https://github.com/mjpost/sacreBLEU',
													        'https://en.wikipedia.org/wiki/BLEU',
													        'https://towardsdatascience.com/evaluating-text-output-in-nlp-bleu-at-your-own-risk-e8609665a213',
													    ]		,)





						def 				snake_case__	(       self		,__UpperCAmelCase		,__UpperCAmelCase		,__UpperCAmelCase     )					->				Any:
													A__	     =							{}
													result.update({'sari': compute_sari(sources=__UpperCAmelCase		,predictions=__UpperCAmelCase		,references=__UpperCAmelCase     )}     )
													result.update({'sacrebleu': compute_sacrebleu(predictions=__UpperCAmelCase		,references=__UpperCAmelCase     )}     )
													result.update({'exact': compute_em(predictions=__UpperCAmelCase		,references=__UpperCAmelCase     )}     )
													return result






"""simple docstring"""




from typing import Dict, Optional

import numpy as np

import datasets


__lowerCamelCase											=  "\nIoU is the area of overlap between the predicted segmentation and the ground truth divided by the area of union\nbetween the predicted segmentation and the ground truth. For binary (two classes) or multi-class segmentation,\nthe mean IoU of the image is calculated by taking the IoU of each class and averaging them.\n"

__lowerCamelCase											=  "\nArgs:\n    predictions (`List[ndarray]`):\n        List of predicted segmentation maps, each of shape (height, width). Each segmentation map can be of a different size.\n    references (`List[ndarray]`):\n        List of ground truth segmentation maps, each of shape (height, width). Each segmentation map can be of a different size.\n    num_labels (`int`):\n        Number of classes (categories).\n    ignore_index (`int`):\n        Index that will be ignored during evaluation.\n    nan_to_num (`int`, *optional*):\n        If specified, NaN values will be replaced by the number defined by the user.\n    label_map (`dict`, *optional*):\n        If specified, dictionary mapping old label indices to new label indices.\n    reduce_labels (`bool`, *optional*, defaults to `False`):\n        Whether or not to reduce all label values of segmentation maps by 1. Usually used for datasets where 0 is used for background,\n        and background itself is not included in all classes of a dataset (e.g. ADE20k). The background label will be replaced by 255.\n\nReturns:\n    `Dict[str, float | ndarray]` comprising various elements:\n    - *mean_iou* (`float`):\n        Mean Intersection-over-Union (IoU averaged over all categories).\n    - *mean_accuracy* (`float`):\n        Mean accuracy (averaged over all categories).\n    - *overall_accuracy* (`float`):\n        Overall accuracy on all images.\n    - *per_category_accuracy* (`ndarray` of shape `(num_labels,)`):\n        Per category accuracy.\n    - *per_category_iou* (`ndarray` of shape `(num_labels,)`):\n        Per category IoU.\n\nExamples:\n\n    >>> import numpy as np\n\n    >>> mean_iou = datasets.load_metric(\"mean_iou\")\n\n    >>> # suppose one has 3 different segmentation maps predicted\n    >>> predicted_1 = np.array([[1, 2], [3, 4], [5, 255]])\n    >>> actual_1 = np.array([[0, 3], [5, 4], [6, 255]])\n\n    >>> predicted_2 = np.array([[2, 7], [9, 2], [3, 6]])\n    >>> actual_2 = np.array([[1, 7], [9, 2], [3, 6]])\n\n    >>> predicted_3 = np.array([[2, 2, 3], [8, 2, 4], [3, 255, 2]])\n    >>> actual_3 = np.array([[1, 2, 2], [8, 2, 1], [3, 255, 1]])\n\n    >>> predicted = [predicted_1, predicted_2, predicted_3]\n    >>> ground_truth = [actual_1, actual_2, actual_3]\n\n    >>> results = mean_iou.compute(predictions=predicted, references=ground_truth, num_labels=10, ignore_index=255, reduce_labels=False)\n    >>> print(results) # doctest: +NORMALIZE_WHITESPACE\n    {'mean_iou': 0.47750000000000004, 'mean_accuracy': 0.5916666666666666, 'overall_accuracy': 0.5263157894736842, 'per_category_iou': array([0.   , 0.   , 0.375, 0.4  , 0.5  , 0.   , 0.5  , 1.   , 1.   , 1.   ]), 'per_category_accuracy': array([0.        , 0.        , 0.75      , 0.66666667, 1.        , 0.        , 0.5       , 1.        , 1.        , 1.        ])}\n"

__lowerCamelCase											=  "\\n@software{MMSegmentation_Contributors_OpenMMLab_Semantic_Segmentation_2020,\nauthor = {{MMSegmentation Contributors}},\nlicense = {Apache-2.0},\nmonth = {7},\ntitle = {{OpenMMLab Semantic Segmentation Toolbox and Benchmark}},\nurl = {https://github.com/open-mmlab/mmsegmentation},\nyear = {2020}\n}"






def   UpperCAmelCase					(	UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__ = None       ,    UpperCamelCase__ = False       ,    ):






							"""simple docstring"""





							if label_map is not None:
														for old_id, new_id in label_map.items():
																					A__	     =							new_id

    # turn into Numpy arrays
							A__	     =							np.array(UpperCamelCase__				)
							A__	     =							np.array(UpperCamelCase__				)

							if reduce_labels:
														A__	     =							255
														A__	     =							label - 1
														A__	     =							255

							A__	     =							label != ignore_index
							A__	     =							np.not_equal(UpperCamelCase__       ,    UpperCamelCase__				)
							A__	     =							pred_label[mask]
							A__	     =							np.array(UpperCamelCase__				)[mask]

							A__	     =							pred_label[pred_label == label]

							A__	     =							np.histogram(UpperCamelCase__       ,    bins=UpperCamelCase__       ,    range=(0, num_labels - 1)				)[0]
							A__	     =							np.histogram(UpperCamelCase__       ,    bins=UpperCamelCase__       ,    range=(0, num_labels - 1)				)[0]
							A__	     =							np.histogram(UpperCamelCase__       ,    bins=UpperCamelCase__       ,    range=(0, num_labels - 1)				)[0]

							A__	     =							area_pred_label + area_label - area_intersect

							return area_intersect, area_union, area_pred_label, area_label






def   UpperCAmelCase					(	UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__ = None       ,    UpperCamelCase__ = False       ,    ):






							"""simple docstring"""





							A__	     =							np.zeros((num_labels,)       ,    dtype=np.floataa				)
							A__	     =							np.zeros((num_labels,)       ,    dtype=np.floataa				)
							A__	     =							np.zeros((num_labels,)       ,    dtype=np.floataa				)
							A__	     =							np.zeros((num_labels,)       ,    dtype=np.floataa				)
							for result, gt_seg_map in zip(UpperCamelCase__       ,    UpperCamelCase__				):
														A__     ,  A__     ,  A__     ,  A__	     =							intersect_and_union(
														    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__				)
														total_area_intersect += area_intersect
														total_area_union += area_union
														total_area_pred_label += area_pred_label
														total_area_label += area_label
							return total_area_intersect, total_area_union, total_area_pred_label, total_area_label






def   UpperCAmelCase					(	UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__ = None       ,    UpperCamelCase__ = None       ,    UpperCamelCase__ = False       ,    ):






							"""simple docstring"""





							A__     ,  A__     ,  A__     ,  A__	     =							total_intersect_and_union(
							    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__       ,    UpperCamelCase__				)

							# compute metrics
							A__	     =							{}

							A__	     =							total_area_intersect.sum() / total_area_label.sum()
							A__	     =							total_area_intersect / total_area_union
							A__	     =							total_area_intersect / total_area_label

							A__	     =							np.nanmean(UpperCamelCase__				)
							A__	     =							np.nanmean(UpperCamelCase__				)
							A__	     =							all_acc
							A__	     =							iou
							A__	     =							acc

							if nan_to_num is not None:
														A__	     =							{metric: np.nan_to_num(UpperCamelCase__       ,    nan=UpperCamelCase__				) for metric, metric_value in metrics.items()}

							return metrics


@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION		,						_KWARGS_DESCRIPTION )
class     UpperCamelCase__(			datasets.Metric ):





						def 				snake_case__	(       self     )					->				str:
													return datasets.MetricInfo(
													    description=_DESCRIPTION		,citation=_CITATION		,inputs_description=_KWARGS_DESCRIPTION		,features=datasets.Features(
													        # 1st Seq - height dim, 2nd - width dim
													        {
													            'predictions': datasets.Sequence(datasets.Sequence(datasets.Value('uint16'     )     )     ),
													            'references': datasets.Sequence(datasets.Sequence(datasets.Value('uint16'     )     )     ),
													        }     )		,reference_urls=[
													        'https://github.com/open-mmlab/mmsegmentation/blob/71c201b1813267d78764f306a297ca717827c4bf/mmseg/core/evaluation/metrics.py'
													    ]		,)





						def 				snake_case__	(       self		,__UpperCAmelCase		,__UpperCAmelCase		,__UpperCAmelCase		,__UpperCAmelCase		,__UpperCAmelCase = None		,__UpperCAmelCase = None		,__UpperCAmelCase = False		,)					->				Tuple:
													A__	     =							mean_iou(
													    results=__UpperCAmelCase		,gt_seg_maps=__UpperCAmelCase		,num_labels=__UpperCAmelCase		,ignore_index=__UpperCAmelCase		,nan_to_num=__UpperCAmelCase		,label_map=__UpperCAmelCase		,reduce_labels=__UpperCAmelCase		,)
													return iou_result





