





import warnings

import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
from sklearn.metrics import pairwise_distances

warnings.filterwarnings("""ignore""")

_SCREAMING_SNAKE_CASE   						=		"""K-MEANS-CLUST/ """


def 				SCREAMING_SNAKE_CASE__    (     __a ,			__a ,			__a=None ):


	if seed is not None:  # useful for obtaining consistent results
		np.random.seed(__UpperCamelCase )
	snake_case_		:      Any           =						data.shape[0]  # number of data points

	# Pick K indices from range [0, N).
	snake_case_		:      Dict           =						np.random.randint(0 ,			__UpperCamelCase ,			__UpperCamelCase )

	# Keep centroids as dense format, as many entries will be nonzero due to averaging.
	# As long as at least one document in a cluster contains a word,
	# it will carry a nonzero weight in the TF-IDF vector of the centroid.
	snake_case_		:      Optional[Any]           =						data[rand_indices, :]

	return centroids


def 				SCREAMING_SNAKE_CASE__    (     __a ,			__a ):
	return pairwise_distances(__UpperCamelCase ,			__UpperCamelCase ,			metric='euclidean' )


def 				SCREAMING_SNAKE_CASE__    (     __a ,			__a ):
	snake_case_		:      Optional[int]           =						centroid_pairwise_dist(__UpperCamelCase ,			__UpperCamelCase )

	# Compute cluster assignments for each data point:
	# Fill in the blank (RHS only)
	snake_case_		:      int           =						np.argmin(__UpperCamelCase ,			axis=1 )

	return cluster_assignment


def 				SCREAMING_SNAKE_CASE__    (     __a ,			__a ,			__a ):
	snake_case_		:      int           =						[]
	for i in range(__UpperCamelCase ):
		# Select all data points that belong to cluster i. Fill in the blank (RHS only)
		snake_case_		:      Tuple           =						data[cluster_assignment == i]
		# Compute the mean of the data points. Fill in the blank (RHS only)
		snake_case_		:      Union[str, Any]           =						member_data_points.mean(axis=0 )
		new_centroids.append(__UpperCamelCase )
	snake_case_		:      int           =						np.array(__UpperCamelCase )

	return new_centroids


def 				SCREAMING_SNAKE_CASE__    (     __a ,			__a ,			__a ,			__a ):
	snake_case_		:      Union[str, Any]           =						0.0
	for i in range(__UpperCamelCase ):
		# Select all data points that belong to cluster i. Fill in the blank (RHS only)
		snake_case_		:      Tuple           =						data[cluster_assignment == i, :]

		if member_data_points.shape[0] > 0:  # check if i-th cluster is non-empty
			# Compute distances from centroid to data points (RHS only)
			snake_case_		:      Any           =						pairwise_distances(
			    __UpperCamelCase ,			[centroids[i]] ,			metric='euclidean' )
			snake_case_		:      Union[str, Any]           =						distances**2
			heterogeneity += np.sum(__UpperCamelCase )

	return heterogeneity


def 				SCREAMING_SNAKE_CASE__    (     __a ,			__a ):
	plt.figure(figsize=(7, 4) )
	plt.plot(__UpperCamelCase ,			linewidth=4 )
	plt.xlabel('# Iterations' )
	plt.ylabel('Heterogeneity' )
	plt.title(f"""Heterogeneity of clustering over time, K={k:d}""" )
	plt.rcParams.update({'font.size': 16} )
	plt.show()


def 				SCREAMING_SNAKE_CASE__    (     __a ,			__a ,			__a ,			__a=5_00 ,			__a=None ,			__a=False ):
	snake_case_		:      List[str]           =						initial_centroids[:]
	snake_case_		:      Tuple           =						None

	for itr in range(__UpperCamelCase ):
		if verbose:
			print(__UpperCamelCase ,			end='' )

		# 1. Make cluster assignments using nearest centroids
		snake_case_		:      str           =						assign_clusters(__UpperCamelCase ,			__UpperCamelCase )

		# 2. Compute a new centroid for each of the k clusters, averaging all data
		#    points assigned to that cluster.
		snake_case_		:      int           =						revise_centroids(__UpperCamelCase ,			__UpperCamelCase ,			__UpperCamelCase )

		# Check for convergence: if none of the assignments changed, stop
		if (
		    prev_cluster_assignment is not None
		    and (prev_cluster_assignment == cluster_assignment).all()
		):
			break

		# Print number of new assignments
		if prev_cluster_assignment is not None:
			snake_case_		:      Union[str, Any]           =						np.sum(prev_cluster_assignment != cluster_assignment )
			if verbose:
				print(
				    f"""    {num_changed:5d} elements changed their cluster assignment.""" )

        # Record heterogeneity convergence metric
		if record_heterogeneity is not None:
			# YOUR CODE HERE
			snake_case_		:      str           =						compute_heterogeneity(__UpperCamelCase ,			__UpperCamelCase ,			__UpperCamelCase ,			__UpperCamelCase )
			record_heterogeneity.append(__UpperCamelCase )

		snake_case_		:      Dict           =						cluster_assignment[:]

	return centroids, cluster_assignment


# Mock test below
if False:  # change to true to run this test case.
						from sklearn import datasets as ds

						_SCREAMING_SNAKE_CASE   						=		ds.load_iris()
						_SCREAMING_SNAKE_CASE   						=		3
						_SCREAMING_SNAKE_CASE   						=		[]
						_SCREAMING_SNAKE_CASE   						=		get_initial_centroids(dataset["""data"""], k, seed=0)
						_SCREAMING_SNAKE_CASE						,				_SCREAMING_SNAKE_CASE   						=		kmeans(
						    dataset["""data"""],
						    k,
						    initial_centroids,
						    maxiter=4_00,
						    record_heterogeneity=heterogeneity,
						    verbose=True,
						)
						plot_heterogeneity(heterogeneity, k)


def 				SCREAMING_SNAKE_CASE__    (     __a ,			__a ,			__a=None ):


	if fill_missing_report:
		snake_case_		:      int           =						df.fillna(value=__UpperCamelCase )
	snake_case_		:      str           =						1
	snake_case_		:      List[Any]           =						df.select_dtypes(np.number ).columns
	snake_case_		:      List[str]           =						(
	    df.groupby(['Cluster'] )[  # construct report dataframe
	        numeric_cols
	    ]  # group by cluster number
	    .agg(
	        [
	            ('sum', np.sum),
	            ('mean_with_zeros', lambda __a : np.mean(np.nan_to_num(__UpperCamelCase ) )),
	            ('mean_without_zeros', lambda __a : x.replace(0 ,			np.NaN ).mean()),
	            (
	                'mean_25-75',
	                lambda __a : np.mean(
	                    np.nan_to_num(
	                        sorted(__UpperCamelCase )[
	                            round(len(__UpperCamelCase ) * 25 / 1_00 ) : round(len(__UpperCamelCase ) * 75 / 1_00 )
	                        ] ) ),
	            ),
	            ('mean_with_na', np.mean),
	            ('min', lambda __a : x.min()),
	            ('5%', lambda __a : x.quantile(0.05 )),
	            ('25%', lambda __a : x.quantile(0.25 )),
	            ('50%', lambda __a : x.quantile(0.50 )),
	            ('75%', lambda __a : x.quantile(0.75 )),
	            ('95%', lambda __a : x.quantile(0.95 )),
	            ('max', lambda __a : x.max()),
	            ('count', lambda __a : x.count()),
	            ('stdev', lambda __a : x.std()),
	            ('mode', lambda __a : x.mode()[0]),
	            ('median', lambda __a : x.median()),
	            ('# > 0', lambda __a : (x > 0).sum()),
	        ] )
	    .T.reset_index()
	    .rename(index=__UpperCamelCase ,			columns={'level_0': 'Features', 'level_1': 'Type'} )
	)  # rename columns
	# calculate the size of cluster(count of clientID's)
	snake_case_		:      List[str]           =						report[
	    (report['Features'] == 'dummy') & (report['Type'] == 'count')
	].copy()  # avoid SettingWithCopyWarning
	snake_case_		:      Optional[Any]           =						(
	    'ClusterSize'  # rename created cluster df to match report column names
	)
	snake_case_		:      List[Any]           =						'# of Customers'
	snake_case_		:      Optional[int]           =						pd.DataFrame(
	    clustersize.iloc[:, 2:].values
	    / clustersize.iloc[:, 2:].values.sum() )
	snake_case_		:      Optional[Any]           =						'% of Customers'  # rename created cluster df to match report column names
	snake_case_		:      Union[str, Any]           =						'ClusterProportion'
	snake_case_		:      Optional[Any]           =						clusterproportion.columns.tolist()
	snake_case_		:      List[str]           =						cols[-2:] + cols[:-2]
	snake_case_		:      Union[str, Any]           =						clusterproportion[cols]  # rearrange columns to match report
	snake_case_		:      List[Any]           =						report.columns
	snake_case_		:      List[Any]           =						pd.DataFrame(
	    abs(
	        report[report['Type'] == 'count'].iloc[:, 2:].values
	        - clustersize.iloc[:, 2:].values ) )  # generating df with count of nan values
	snake_case_		:      int           =						0
	snake_case_		:      List[str]           =						'# of nan'
	snake_case_		:      Dict           =						report[
	    report['Type'] == 'count'
	].Features.tolist()  # filling values in order to match report
	snake_case_		:      Optional[int]           =						a.columns.tolist()
	snake_case_		:      int           =						cols[-2:] + cols[:-2]
	snake_case_		:      Optional[int]           =						a[cols]  # rearrange columns to match report
	snake_case_		:      Dict           =						report.columns  # rename columns to match report
	snake_case_		:      List[str]           =						report.drop(
	    report[report.Type == 'count'].index )  # drop count values except cluster size
	snake_case_		:      List[Any]           =						pd.concat(
	    [report, a, clustersize, clusterproportion] ,			axis=0 )  # concat report with clustert size and nan values
	snake_case_		:      Optional[Any]           =						report['Features'].isin(__UpperCamelCase )
	snake_case_		:      Any           =						report.columns.tolist()
	snake_case_		:      Tuple           =						cols[0:2] + cols[-1:] + cols[2:-1]
	snake_case_		:      List[Any]           =						report[cols]
	snake_case_		:      int           =						{
	    'ClusterSize': 9,
	    'ClusterProportion': 8,
	    'mean_with_zeros': 7,
	    'mean_with_na': 6,
	    'max': 5,
	    '50%': 4,
	    'min': 3,
	    '25%': 2,
	    '75%': 1,
	    '# of nan': 0,
	    '# > 0': -1,
	    'sum_with_na': -2,
	}
	snake_case_		:      Union[str, Any]           =						(
	    report.assign(
	        Sortera=lambda __a : x.Type.map(__UpperCamelCase ) ,			Sortera=lambda __a : list(reversed(range(len(__UpperCamelCase ) ) ) ) ,			)
	    .sort_values(['Sorter1', 'Mark', 'Sorter2'] ,			ascending=__UpperCamelCase )
	    .drop(['Sorter1', 'Sorter2'] ,			axis=1 )
	)
	snake_case_		:      Tuple           =						''
	snake_case_		:      List[Any]           =						report.reset_index()
	snake_case_		:      Optional[int]           =						report.drop(columns=['index'] )
	return report


if __name__ == "__main__":
						import doctest

						doctest.testmod()


"""simple docstring"""

from copy import deepcopy
from unittest.case import TestCase

import pytest

from datasets.arrow_dataset import Dataset
from datasets.features import Audio, ClassLabel, Features, Image, Sequence, Value
from datasets.info import DatasetInfo
from datasets.tasks import (
    AudioClassification,
    AutomaticSpeechRecognition,
    ImageClassification,
    LanguageModeling,
    QuestionAnsweringExtractive,
    Summarization,
    TextClassification,
    task_template_from_dict,
)
from datasets.utils.py_utils import asdict


__lowercase    =				{
    '''id''': '''5733be284776f41900661182''',
    '''title''': '''University_of_Notre_Dame''',
    '''context''': '''Architecturally, the school has a Catholic character. Atop the Main Building\'s gold dome is a golden statue of the Virgin Mary. Immediately in front of the Main Building and facing it, is a copper statue of Christ with arms upraised with the legend "Venite Ad Me Omnes". Next to the Main Building is the Basilica of the Sacred Heart. Immediately behind the basilica is the Grotto, a Marian place of prayer and reflection. It is a replica of the grotto at Lourdes, France where the Virgin Mary reputedly appeared to Saint Bernadette Soubirous in 1858. At the end of the main drive (and in a direct line that connects through 3 statues and the Gold Dome), is a simple, modern stone statue of Mary.''',
    '''question''': '''To whom did the Virgin Mary allegedly appear in 1858 in Lourdes France?''',
    '''answers''': {'''text''': ['''Saint Bernadette Soubirous'''], '''answer_start''': [515]},
}


@pytest.mark.parametrize(
    '''task_cls'''							,					[
        AudioClassification,
        AutomaticSpeechRecognition,
        ImageClassification,
        LanguageModeling,
        QuestionAnsweringExtractive,
        Summarization,
        TextClassification,
    ]							,					)
def    lowerCAmelCase			(__UpperCamelCase							:    List[str]			):
							"""simple docstring"""


							__UpperCamelCase							=task_cls()
							__UpperCamelCase							=asdict(__UpperCamelCase			)
							__UpperCamelCase							=task_template_from_dict(__UpperCamelCase			)
							assert task == reloaded






class 		_lowercase :



						"""simple docstring"""




						def   UpperCAmelCase_ (				self							:    Union[str, Any]				)				->				List[Any]:
													'''simple docstring'''



													__UpperCamelCase							=LanguageModeling(text_column='''input_text'''				)
													assert {"input_text": "text"} == task.column_mapping





						def   UpperCAmelCase_ (				self							:    str				)				->				int:
													'''simple docstring'''



													__UpperCamelCase							=Features({'''text''': Value('''string'''				)}				)
													__UpperCamelCase							={'''text_column''': '''input_text'''}
													__UpperCamelCase							=LanguageModeling.from_dict(UpperCamelCase__				)
													assert "language-modeling" == task.task
													assert input_schema == task.input_schema






class 		_lowercase (						__a      ):



						"""simple docstring"""




						def   UpperCAmelCase_ (				self							:    Optional[Any]				)				->				Dict:
													'''simple docstring'''



													__UpperCamelCase							=sorted(['''pos''', '''neg''']				)





						def   UpperCAmelCase_ (				self							:    Tuple				)				->				Tuple:
													'''simple docstring'''



													__UpperCamelCase							=TextClassification(text_column='''input_text'''     , label_column='''input_label'''				)
													self.assertDictEqual({'''input_text''': '''text''', '''input_label''': '''labels'''}     , task.column_mapping				)





						def   UpperCAmelCase_ (				self							:    Union[str, Any]				)				->				Union[str, Any]:
													'''simple docstring'''



													__UpperCamelCase							=Features({'''text''': Value('''string'''				)}				)
													# Labels are cast to tuple during `TextClassification.__post_init__`, so we do the same here
													__UpperCamelCase							=Features({'''labels''': ClassLabel}				)
													__UpperCamelCase							={'''text_column''': '''input_text''', '''label_column''': '''input_labels'''}
													__UpperCamelCase							=TextClassification.from_dict(UpperCamelCase__				)
													self.assertEqual('''text-classification'''     , task.task				)
													self.assertEqual(UpperCamelCase__     , task.input_schema				)
													self.assertEqual(UpperCamelCase__     , task.label_schema				)





						def   UpperCAmelCase_ (				self							:    Tuple				)				->				Optional[Any]:
													'''simple docstring'''



													__UpperCamelCase							=TextClassification(text_column='''input_text'''     , label_column='''input_label'''				)
													self.assertEqual(task.label_schema['''labels''']     , UpperCamelCase__				)
													__UpperCamelCase							=task.align_with_features(Features({'''input_label''': ClassLabel(names=self.labels				)}				)				)
													self.assertEqual(task.label_schema['''labels''']     , ClassLabel(names=self.labels				)				)






class 		_lowercase (						__a      ):



						"""simple docstring"""




						def   UpperCAmelCase_ (				self							:    Dict				)				->				List[Any]:
													'''simple docstring'''



													__UpperCamelCase							=QuestionAnsweringExtractive(
													    context_column='''input_context'''     , question_column='''input_question'''     , answers_column='''input_answers'''				)
													self.assertDictEqual(
													    {'''input_context''': '''context''', '''input_question''': '''question''', '''input_answers''': '''answers'''}     , task.column_mapping				)





						def   UpperCAmelCase_ (				self							:    Optional[Any]				)				->				Optional[Any]:
													'''simple docstring'''



													__UpperCamelCase							=Features({'''question''': Value('''string'''				), '''context''': Value('''string'''				)}				)
													__UpperCamelCase							=Features(
													    {
													        '''answers''': Sequence(
													            {
													                '''text''': Value('''string'''				),
													                '''answer_start''': Value('''int32'''				),
													            }				)
													    }				)
													__UpperCamelCase							={
													    '''context_column''': '''input_input_context''',
													    '''question_column''': '''input_question''',
													    '''answers_column''': '''input_answers''',
													}
													__UpperCamelCase							=QuestionAnsweringExtractive.from_dict(UpperCamelCase__				)
													self.assertEqual('''question-answering-extractive'''     , task.task				)
													self.assertEqual(UpperCamelCase__     , task.input_schema				)
													self.assertEqual(UpperCamelCase__     , task.label_schema				)






class 		_lowercase (						__a      ):



						"""simple docstring"""




						def   UpperCAmelCase_ (				self							:    List[Any]				)				->				str:
													'''simple docstring'''



													__UpperCamelCase							=Summarization(text_column='''input_text'''     , summary_column='''input_summary'''				)
													self.assertDictEqual({'''input_text''': '''text''', '''input_summary''': '''summary'''}     , task.column_mapping				)





						def   UpperCAmelCase_ (				self							:    int				)				->				List[Any]:
													'''simple docstring'''



													__UpperCamelCase							=Features({'''text''': Value('''string'''				)}				)
													__UpperCamelCase							=Features({'''summary''': Value('''string'''				)}				)
													__UpperCamelCase							={'''text_column''': '''input_text''', '''summary_column''': '''input_summary'''}
													__UpperCamelCase							=Summarization.from_dict(UpperCamelCase__				)
													self.assertEqual('''summarization'''     , task.task				)
													self.assertEqual(UpperCamelCase__     , task.input_schema				)
													self.assertEqual(UpperCamelCase__     , task.label_schema				)






class 		_lowercase (						__a      ):



						"""simple docstring"""




						def   UpperCAmelCase_ (				self							:    List[Any]				)				->				Dict:
													'''simple docstring'''



													__UpperCamelCase							=AutomaticSpeechRecognition(audio_column='''input_audio'''     , transcription_column='''input_transcription'''				)
													self.assertDictEqual({'''input_audio''': '''audio''', '''input_transcription''': '''transcription'''}     , task.column_mapping				)





						def   UpperCAmelCase_ (				self							:    Union[str, Any]				)				->				List[str]:
													'''simple docstring'''



													__UpperCamelCase							=Features({'''audio''': Audio()}				)
													__UpperCamelCase							=Features({'''transcription''': Value('''string'''				)}				)
													__UpperCamelCase							={
													    '''audio_column''': '''input_audio''',
													    '''transcription_column''': '''input_transcription''',
													}
													__UpperCamelCase							=AutomaticSpeechRecognition.from_dict(UpperCamelCase__				)
													self.assertEqual('''automatic-speech-recognition'''     , task.task				)
													self.assertEqual(UpperCamelCase__     , task.input_schema				)
													self.assertEqual(UpperCamelCase__     , task.label_schema				)






class 		_lowercase (						__a      ):



						"""simple docstring"""




						def   UpperCAmelCase_ (				self							:    List[str]				)				->				List[str]:
													'''simple docstring'''



													__UpperCamelCase							=sorted(['''pos''', '''neg''']				)





						def   UpperCAmelCase_ (				self							:    Union[str, Any]				)				->				int:
													'''simple docstring'''



													__UpperCamelCase							=AudioClassification(audio_column='''input_audio'''     , label_column='''input_label'''				)
													self.assertDictEqual({'''input_audio''': '''audio''', '''input_label''': '''labels'''}     , task.column_mapping				)





						def   UpperCAmelCase_ (				self							:    Dict				)				->				Any:
													'''simple docstring'''



													__UpperCamelCase							=Features({'''audio''': Audio()}				)
													__UpperCamelCase							=Features({'''labels''': ClassLabel}				)
													__UpperCamelCase							={
													    '''audio_column''': '''input_image''',
													    '''label_column''': '''input_label''',
													}
													__UpperCamelCase							=AudioClassification.from_dict(UpperCamelCase__				)
													self.assertEqual('''audio-classification'''     , task.task				)
													self.assertEqual(UpperCamelCase__     , task.input_schema				)
													self.assertEqual(UpperCamelCase__     , task.label_schema				)





						def   UpperCAmelCase_ (				self							:    Tuple				)				->				List[str]:
													'''simple docstring'''



													__UpperCamelCase							=AudioClassification(audio_column='''input_audio'''     , label_column='''input_label'''				)
													self.assertEqual(task.label_schema['''labels''']     , UpperCamelCase__				)
													__UpperCamelCase							=task.align_with_features(Features({'''input_label''': ClassLabel(names=self.labels				)}				)				)
													self.assertEqual(task.label_schema['''labels''']     , ClassLabel(names=self.labels				)				)






class 		_lowercase (						__a      ):



						"""simple docstring"""




						def   UpperCAmelCase_ (				self							:    Optional[Any]				)				->				str:
													'''simple docstring'''



													__UpperCamelCase							=sorted(['''pos''', '''neg''']				)





						def   UpperCAmelCase_ (				self							:    str				)				->				Tuple:
													'''simple docstring'''



													__UpperCamelCase							=ImageClassification(image_column='''input_image'''     , label_column='''input_label'''				)
													self.assertDictEqual({'''input_image''': '''image''', '''input_label''': '''labels'''}     , task.column_mapping				)





						def   UpperCAmelCase_ (				self							:    Optional[Any]				)				->				List[str]:
													'''simple docstring'''



													__UpperCamelCase							=Features({'''image''': Image()}				)
													__UpperCamelCase							=Features({'''labels''': ClassLabel}				)
													__UpperCamelCase							={
													    '''image_column''': '''input_image''',
													    '''label_column''': '''input_label''',
													}
													__UpperCamelCase							=ImageClassification.from_dict(UpperCamelCase__				)
													self.assertEqual('''image-classification'''     , task.task				)
													self.assertEqual(UpperCamelCase__     , task.input_schema				)
													self.assertEqual(UpperCamelCase__     , task.label_schema				)





						def   UpperCAmelCase_ (				self							:    str				)				->				Optional[int]:
													'''simple docstring'''



													__UpperCamelCase							=ImageClassification(image_column='''input_image'''     , label_column='''input_label'''				)
													self.assertEqual(task.label_schema['''labels''']     , UpperCamelCase__				)
													__UpperCamelCase							=task.align_with_features(Features({'''input_label''': ClassLabel(names=self.labels				)}				)				)
													self.assertEqual(task.label_schema['''labels''']     , ClassLabel(names=self.labels				)				)






class 		_lowercase (						__a      ):



						"""simple docstring"""




						def   UpperCAmelCase_ (				self							:    Optional[Any]				)				->				List[Any]:
													'''simple docstring'''



													__UpperCamelCase							=DatasetInfo(task_templates=QuestionAnsweringExtractive()				)
													__UpperCamelCase							=Dataset.from_dict({k: [v] for k, v in SAMPLE_QUESTION_ANSWERING_EXTRACTIVE.items()}     , info=UpperCamelCase__				)
													assert isinstance(dataset.info.task_templates     , UpperCamelCase__				)
													assert len(dataset.info.task_templates				) == 1

													def keep_task(UpperCamelCase__							:    Optional[int]				):
																				return x

													def dont_keep_task(UpperCamelCase__							:    Optional[int]				):
																				__UpperCamelCase							=deepcopy(UpperCamelCase__				)
																				__UpperCamelCase							=0
																				return out

													__UpperCamelCase							=dataset.map(UpperCamelCase__				)
													assert mapped_dataset.info.task_templates == dataset.info.task_templates
													# reload from cache
													__UpperCamelCase							=dataset.map(UpperCamelCase__				)
													assert mapped_dataset.info.task_templates == dataset.info.task_templates

													__UpperCamelCase							=dataset.map(UpperCamelCase__				)
													assert mapped_dataset.info.task_templates == []
													# reload from cache
													__UpperCamelCase							=dataset.map(UpperCamelCase__				)
													assert mapped_dataset.info.task_templates == []





						def   UpperCAmelCase_ (				self							:    List[str]				)				->				Dict:
													'''simple docstring'''



													__UpperCamelCase							=Features({'''text''': Value('''string'''				), '''label''': ClassLabel(names=('''pos''', '''neg''')				)}				)
													__UpperCamelCase							=TextClassification(text_column='''text'''     , label_column='''label'''				)
													__UpperCamelCase							=DatasetInfo(features=UpperCamelCase__     , task_templates=UpperCamelCase__				)
													__UpperCamelCase							=Dataset.from_dict({'''text''': ['''A sentence.'''], '''label''': ['''pos''']}     , info=UpperCamelCase__				)

													def process(UpperCamelCase__							:    Any				):
																				return example

													__UpperCamelCase							=dataset.remove_columns('''label'''				)
													__UpperCamelCase							=modified_dataset.map(UpperCamelCase__				)
													assert mapped_dataset.info.task_templates == []



