



"""simple docstring"""






import coval  # From: git+https://github.com/ns-moosavi/coval.git # noqa: F401
from coval.conll import reader, util
from coval.eval import evaluator

import datasets


_lowercase : Optional[Any]      						=						datasets.logging.get_logger(__name__)


_lowercase : List[str]      						=						"\\n@InProceedings{moosavi2019minimum,\n    author = { Nafise Sadat Moosavi, Leo Born, Massimo Poesio and Michael Strube},\n    title = {Using Automatically Extracted Minimum Spans to Disentangle Coreference Evaluation from Boundary Detection},\n    year = {2019},\n    booktitle = {Proceedings of the 57th Annual Meeting of\n        the Association for Computational Linguistics (Volume 1: Long Papers)},\n    publisher = {Association for Computational Linguistics},\n    address = {Florence, Italy},\n}\n\n@inproceedings{10.3115/1072399.1072405,\nauthor = {Vilain, Marc and Burger, John and Aberdeen, John and Connolly, Dennis and Hirschman, Lynette},\ntitle = {A Model-Theoretic Coreference Scoring Scheme},\nyear = {1995},\nisbn = {1558604022},\npublisher = {Association for Computational Linguistics},\naddress = {USA},\nurl = {https://doi.org/10.3115/1072399.1072405},\ndoi = {10.3115/1072399.1072405},\nbooktitle = {Proceedings of the 6th Conference on Message Understanding},\npages = {45–52},\nnumpages = {8},\nlocation = {Columbia, Maryland},\nseries = {MUC6 ’95}\n}\n\n@INPROCEEDINGS{Bagga98algorithmsfor,\n    author = {Amit Bagga and Breck Baldwin},\n    title = {Algorithms for Scoring Coreference Chains},\n    booktitle = {In The First International Conference on Language Resources and Evaluation Workshop on Linguistics Coreference},\n    year = {1998},\n    pages = {563--566}\n}\n\n@INPROCEEDINGS{Luo05oncoreference,\n    author = {Xiaoqiang Luo},\n    title = {On coreference resolution performance metrics},\n    booktitle = {In Proc. of HLT/EMNLP},\n    year = {2005},\n    pages = {25--32},\n    publisher = {URL}\n}\n\n@inproceedings{moosavi-strube-2016-coreference,\n    title = \"Which Coreference Evaluation Metric Do You Trust? A Proposal for a Link-based Entity Aware Metric\",\n    author = \"Moosavi, Nafise Sadat  and\n      Strube, Michael\",\n    booktitle = \"Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)\",\n    month = aug,\n    year = \"2016\",\n    address = \"Berlin, Germany\",\n    publisher = \"Association for Computational Linguistics\",\n    url = \"https://www.aclweb.org/anthology/P16-1060\",\n    doi = \"10.18653/v1/P16-1060\",\n    pages = \"632--642\",\n}\n\n"

_lowercase : Optional[Any]      						=						"\\nCoVal is a coreference evaluation tool for the CoNLL and ARRAU datasets which\nimplements of the common evaluation metrics including MUC [Vilain et al, 1995],\nB-cubed [Bagga and Baldwin, 1998], CEAFe [Luo et al., 2005],\nLEA [Moosavi and Strube, 2016] and the averaged CoNLL score\n(the average of the F1 values of MUC, B-cubed and CEAFe)\n[Denis and Baldridge, 2009a; Pradhan et al., 2011].\n\nThis wrapper of CoVal currently only work with CoNLL line format:\nThe CoNLL format has one word per line with all the annotation for this word in column separated by spaces:\nColumn	Type	Description\n1	Document ID	This is a variation on the document filename\n2	Part number	Some files are divided into multiple parts numbered as 000, 001, 002, ... etc.\n3	Word number\n4	Word itself	This is the token as segmented/tokenized in the Treebank. Initially the *_skel file contain the placeholder [WORD] which gets replaced by the actual token from the Treebank which is part of the OntoNotes release.\n5	Part-of-Speech\n6	Parse bit	This is the bracketed structure broken before the first open parenthesis in the parse, and the word/part-of-speech leaf replaced with a *. The full parse can be created by substituting the asterix with the \"([pos] [word])\" string (or leaf) and concatenating the items in the rows of that column.\n7	Predicate lemma	The predicate lemma is mentioned for the rows for which we have semantic role information. All other rows are marked with a \"-\"\n8	Predicate Frameset ID	This is the PropBank frameset ID of the predicate in Column 7.\n9	Word sense	This is the word sense of the word in Column 3.\n10	Speaker/Author	This is the speaker or author name where available. Mostly in Broadcast Conversation and Web Log data.\n11	Named Entities	These columns identifies the spans representing various named entities.\n12:N	Predicate Arguments	There is one column each of predicate argument structure information for the predicate mentioned in Column 7.\nN	Coreference	Coreference chain information encoded in a parenthesis structure.\nMore informations on the format can be found here (section \"*_conll File Format\"): http://www.conll.cemantix.org/2012/data.html\n\nDetails on the evaluation on CoNLL can be found here: https://github.com/ns-moosavi/coval/blob/master/conll/README.md\n\nCoVal code was written by @ns-moosavi.\nSome parts are borrowed from https://github.com/clarkkev/deep-coref/blob/master/evaluation.py\nThe test suite is taken from https://github.com/conll/reference-coreference-scorers/\nMention evaluation and the test suite are added by @andreasvc.\nParsing CoNLL files is developed by Leo Born.\n"

_lowercase : Tuple      						=						"\nCalculates coreference evaluation metrics.\nArgs:\n    predictions: list of sentences. Each sentence is a list of word predictions to score in the CoNLL format.\n        Each prediction is a word with its annotations as a string made of columns joined with spaces.\n        Only columns 4, 5, 6 and the last column are used (word, POS, Pars and coreference annotation)\n        See the details on the format in the description of the metric.\n    references: list of sentences. Each sentence is a list of word reference to score in the CoNLL format.\n        Each reference is a word with its annotations as a string made of columns joined with spaces.\n        Only columns 4, 5, 6 and the last column are used (word, POS, Pars and coreference annotation)\n        See the details on the format in the description of the metric.\n    keep_singletons: After extracting all mentions of key or system files,\n        mentions whose corresponding coreference chain is of size one,\n        are considered as singletons. The default evaluation mode will include\n        singletons in evaluations if they are included in the key or the system files.\n        By setting 'keep_singletons=False', all singletons in the key and system files\n        will be excluded from the evaluation.\n    NP_only: Most of the recent coreference resolvers only resolve NP mentions and\n        leave out the resolution of VPs. By setting the 'NP_only' option, the scorer will only evaluate the resolution of NPs.\n    min_span: By setting 'min_span', the scorer reports the results based on automatically detected minimum spans.\n        Minimum spans are determined using the MINA algorithm.\n\nReturns:\n    'mentions': mentions\n    'muc': MUC metric [Vilain et al, 1995]\n    'bcub': B-cubed [Bagga and Baldwin, 1998]\n    'ceafe': CEAFe [Luo et al., 2005]\n    'lea': LEA [Moosavi and Strube, 2016]\n    'conll_score': averaged CoNLL score (the average of the F1 values of MUC, B-cubed and CEAFe)\n\nExamples:\n\n    >>> coval = datasets.load_metric('coval')\n    >>> words = ['bc/cctv/00/cctv_0005   0   0       Thank   VBP  (TOP(S(VP*    thank  01   1    Xu_li  *           (V*)        *       -',\n    ... 'bc/cctv/00/cctv_0005   0   1         you   PRP        (NP*)      -    -   -    Xu_li  *        (ARG1*)   (ARG0*)   (116)',\n    ... 'bc/cctv/00/cctv_0005   0   2    everyone    NN        (NP*)      -    -   -    Xu_li  *    (ARGM-DIS*)        *    (116)',\n    ... 'bc/cctv/00/cctv_0005   0   3         for    IN        (PP*       -    -   -    Xu_li  *        (ARG2*         *       -',\n    ... 'bc/cctv/00/cctv_0005   0   4    watching   VBG   (S(VP*))))   watch  01   1    Xu_li  *             *)      (V*)      -',\n    ... 'bc/cctv/00/cctv_0005   0   5           .     .          *))      -    -   -    Xu_li  *             *         *       -']\n    >>> references = [words]\n    >>> predictions = [words]\n    >>> results = coval.compute(predictions=predictions, references=references)\n    >>> print(results) # doctest:+ELLIPSIS\n    {'mentions/recall': 1.0,[...] 'conll_score': 100.0}\n"






def      snake_case__   (		__lowerCamelCase				:    int							,		__lowerCamelCase				:    Any							,		__lowerCamelCase				:    List[str]=False							,		__lowerCamelCase				:    Any=False							,		__lowerCamelCase				:    List[Any]=True							,		__lowerCamelCase				:    int=False							,		__lowerCamelCase				:    Any="dummy_doc"	):
			"""simple docstring"""
			lowerCamelCase__		:		List[str]			={doc: key_lines}
			lowerCamelCase__		:		Optional[int]			={doc: sys_lines}

			lowerCamelCase__		:		List[Any]			={}

			lowerCamelCase__		:		Dict			=0
			lowerCamelCase__		:		Optional[Any]			=0
			lowerCamelCase__		:		Any			=0
			lowerCamelCase__		:		Tuple			=0
			lowerCamelCase__		:		Optional[int]			=0
			lowerCamelCase__		:		Any			=0

			lowerCamelCase__	,   lowerCamelCase__		:		Optional[int]			=reader.get_doc_mentions(__lowerCamelCase							,		key_doc_lines[doc]							,		__lowerCamelCase	)
			key_singletons_num += singletons_num

			if NP_only or min_span:
						lowerCamelCase__		:		List[Any]			=reader.set_annotated_parse_trees(__lowerCamelCase							,		key_doc_lines[doc]							,		__lowerCamelCase							,		__lowerCamelCase	)

			lowerCamelCase__	,   lowerCamelCase__		:		int			=reader.get_doc_mentions(__lowerCamelCase							,		sys_doc_lines[doc]							,		__lowerCamelCase	)
			sys_singletons_num += singletons_num

			if NP_only or min_span:
						lowerCamelCase__		:		Optional[int]			=reader.set_annotated_parse_trees(__lowerCamelCase							,		key_doc_lines[doc]							,		__lowerCamelCase							,		__lowerCamelCase	)

			if remove_nested:
						lowerCamelCase__	,   lowerCamelCase__		:		Union[str, Any]			=reader.remove_nested_coref_mentions(__lowerCamelCase							,		__lowerCamelCase	)
						key_nested_coref_num += nested_mentions
						key_removed_nested_clusters += removed_clusters

						lowerCamelCase__	,   lowerCamelCase__		:		List[str]			=reader.remove_nested_coref_mentions(__lowerCamelCase							,		__lowerCamelCase	)
						sys_nested_coref_num += nested_mentions
						sys_removed_nested_clusters += removed_clusters

			lowerCamelCase__		:		str			=reader.get_mention_assignments(__lowerCamelCase							,		__lowerCamelCase	)
			lowerCamelCase__		:		List[str]			=reader.get_mention_assignments(__lowerCamelCase							,		__lowerCamelCase	)

			lowerCamelCase__		:		Optional[int]			=(key_clusters, sys_clusters, key_mention_sys_cluster, sys_mention_key_cluster)

			if remove_nested:
						logger.info(
						    '''Number of removed nested coreferring mentions in the key '''
						    f'''annotation: {key_nested_coref_num}; and system annotation: {sys_nested_coref_num}'''	)
						logger.info(
						    '''Number of resulting singleton clusters in the key '''
						    f'''annotation: {key_removed_nested_clusters}; and system annotation: {sys_removed_nested_clusters}'''	)

			if not keep_singletons:
						logger.info(
						    f'''{key_singletons_num:d} and {sys_singletons_num:d} singletons are removed from the key and system '''
						    '''files, respectively'''	)

			return doc_coref_infos






def      snake_case__   (		__lowerCamelCase				:    Optional[int]							,		__lowerCamelCase				:    int							,		__lowerCamelCase				:    int							,		__lowerCamelCase				:    str							,		__lowerCamelCase				:    List[str]							,		__lowerCamelCase				:    int							,		__lowerCamelCase				:    int	):
			"""simple docstring"""
			lowerCamelCase__		:		int			=get_coref_infos(__lowerCamelCase							,		__lowerCamelCase							,		__lowerCamelCase							,		__lowerCamelCase							,		__lowerCamelCase							,		__lowerCamelCase	)

			lowerCamelCase__		:		Union[str, Any]			={}
			lowerCamelCase__		:		str			=0
			lowerCamelCase__		:		Tuple			=0

			for name, metric in metrics:
						lowerCamelCase__	,   lowerCamelCase__	,   lowerCamelCase__		:		List[Any]			=evaluator.evaluate_documents(__lowerCamelCase							,		__lowerCamelCase							,		beta=1	)
						if name in ["muc", "bcub", "ceafe"]:
									conll += fa
									conll_subparts_num += 1
						output_scores.update({f'''{name}/recall''': recall, f'''{name}/precision''': precision, f'''{name}/f1''': fa}	)

						logger.info(
						    name.ljust(10	)							,		f'''Recall: {recall * 100:.2f}'''							,		f''' Precision: {precision * 100:.2f}'''							,		f''' F1: {fa * 100:.2f}'''							,		)

			if conll_subparts_num == 3:
						lowerCamelCase__		:		Any			=(conll / 3) * 100
						logger.info(f'''CoNLL score: {conll:.2f}'''	)
						output_scores.update({'''conll_score''': conll}	)

			return output_scores






def      snake_case__   (		__lowerCamelCase				:    Tuple	):
			"""simple docstring"""
			lowerCamelCase__		:		Union[str, Any]			=False
			for line in key_lines:
						if not line.startswith('''#'''	):
									if len(line.split()	) > 6:
												lowerCamelCase__		:		List[Any]			=line.split()[5]
												if not parse_col == "-":
															lowerCamelCase__		:		int			=True
															break
												else:
															break
			return has_gold_parse

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


					'''simple docstring'''





					def 		snake_case       (       self							:  Optional[Any]     )->					int:
								return datasets.MetricInfo(
								    description=_DESCRIPTION,  citation=_CITATION,  inputs_description=_KWARGS_DESCRIPTION,  features=datasets.Features(
								        {
								            '''predictions''': datasets.Sequence(datasets.Value('''string'''     )     ),
								            '''references''': datasets.Sequence(datasets.Value('''string'''     )     ),
								        }     ),  codebase_urls=['''https://github.com/ns-moosavi/coval'''],  reference_urls=[
								        '''https://github.com/ns-moosavi/coval''',
								        '''https://www.aclweb.org/anthology/P16-1060''',
								        '''http://www.conll.cemantix.org/2012/data.html''',
								    ],  )




					def 		snake_case       (       self							:  Optional[Any],  lowerCamelCase							:  List[Any],  lowerCamelCase							:  Dict,  lowerCamelCase							:  Optional[Any]=True,  lowerCamelCase							:  Dict=False,  lowerCamelCase							:  List[Any]=False,  lowerCamelCase							:  Optional[int]=False     )->					int:
								lowerCamelCase__		:		Optional[Any]			=[
								    ('''mentions''', evaluator.mentions),
								    ('''muc''', evaluator.muc),
								    ('''bcub''', evaluator.b_cubed),
								    ('''ceafe''', evaluator.ceafe),
								    ('''lea''', evaluator.lea),
								]

								if min_span:
											lowerCamelCase__		:		Dict			=util.check_gold_parse_annotation(lowerCamelCase     )
											if not has_gold_parse:
														raise NotImplementedError('''References should have gold parse annotation to use \'min_span\'.'''     )
														# util.parse_key_file(key_file)
														# key_file = key_file + ".parsed"

								lowerCamelCase__		:		List[Any]			=evaluate(
								    key_lines=lowerCamelCase,  sys_lines=lowerCamelCase,  metrics=lowerCamelCase,  NP_only=lowerCamelCase,  remove_nested=lowerCamelCase,  keep_singletons=lowerCamelCase,  min_span=lowerCamelCase,  )

								return score









"""simple docstring"""






import os
import time
from dataclasses import dataclass, field
from enum import Enum
from typing import Dict, List, Optional, Union

import torch
from filelock import FileLock
from torch.utils.data import Dataset

from ...models.auto.modeling_auto import MODEL_FOR_QUESTION_ANSWERING_MAPPING
from ...tokenization_utils import PreTrainedTokenizer
from ...utils import logging
from ..processors.squad import SquadFeatures, SquadVaProcessor, SquadVaProcessor, squad_convert_examples_to_features


_lowercase : Optional[int]      						=						logging.get_logger(__name__)

_lowercase : Tuple      						=						list(MODEL_FOR_QUESTION_ANSWERING_MAPPING.keys())
_lowercase : Tuple      						=						tuple(conf.model_type for conf in MODEL_CONFIG_CLASSES)

@dataclass
class        __SCREAMING_SNAKE_CASE	:


					'''simple docstring'''





					_a   			=							field(
					    default=lowerCAmelCase_		,   metadata={'help': 'Model type selected in the list: ' + ', '.join(lowerCAmelCase_   )}   )
					_a   			=							field(
					    default=lowerCAmelCase_		,   metadata={'help': 'The input data dir. Should contain the .json files for the SQuAD task.'}   )
					_a   			=							field(
					    default=1_2_8		,   metadata={
					        'help': (
					            'The maximum total input sequence length after tokenization. Sequences longer '
					            'than this will be truncated, sequences shorter will be padded.'
					        )
					    }		,   )
					_a   			=							field(
					    default=1_2_8		,   metadata={'help': 'When splitting up a long document into chunks, how much stride to take between chunks.'}		,   )
					_a   			=							field(
					    default=6_4		,   metadata={
					        'help': (
					            'The maximum number of tokens for the question. Questions longer than this will '
					            'be truncated to this length.'
					        )
					    }		,   )
					_a   			=							field(
					    default=3_0		,   metadata={
					        'help': (
					            'The maximum length of an answer that can be generated. This is needed because the start '
					            'and end predictions are not conditioned on one another.'
					        )
					    }		,   )
					_a   			=							field(
					    default=lowerCAmelCase_		,   metadata={'help': 'Overwrite the cached training and evaluation sets'}   )
					_a   			=							field(
					    default=lowerCAmelCase_		,   metadata={'help': 'If true, the SQuAD examples contain some that do not have an answer.'}   )
					_a   			=							field(
					    default=0.0		,   metadata={'help': 'If null_score - best_non_null is greater than the threshold predict null.'}   )
					_a   			=							field(
					    default=2_0		,   metadata={'help': 'If null_score - best_non_null is greater than the threshold predict null.'}   )
					_a   			=							field(
					    default=0		,   metadata={
					        'help': (
					            'language id of input for language-specific xlm models (see'
					            ' tokenization_xlm.PRETRAINED_INIT_CONFIGURATION)'
					        )
					    }		,   )
					_a   			=							field(default=1		,   metadata={'help': 'multiple threads for converting example to features'}   )





class        __SCREAMING_SNAKE_CASE	(      lowerCAmelCase_   ):


					'''simple docstring'''





					_a   			=							'train'
					_a   			=							'dev'





class        __SCREAMING_SNAKE_CASE	(      lowerCAmelCase_   ):


					'''simple docstring'''





					_a   			=							42
					_a   			=							42
					_a   			=							42
					_a   			=							42



					def __init__(       self							:  Dict,  lowerCamelCase							:  SquadDataTrainingArguments,  lowerCamelCase							:  PreTrainedTokenizer,  lowerCamelCase							:  Optional[int] = None,  lowerCamelCase							:  Union[str, Split] = Split.train,  lowerCamelCase							:  Optional[bool] = False,  lowerCamelCase							:  Optional[str] = None,  lowerCamelCase							:  Optional[str] = "pt",  )->					List[str]:
								lowerCamelCase__		:		List[str]			=args
								lowerCamelCase__		:		Optional[Any]			=is_language_sensitive
								lowerCamelCase__		:		Any			=SquadVaProcessor() if args.version_2_with_negative else SquadVaProcessor()
								if isinstance(lowerCamelCase,  lowerCamelCase     ):
											try:
														lowerCamelCase__		:		int			=Split[mode]
											except KeyError:
														raise KeyError('''mode is not a valid split name'''     )
								lowerCamelCase__		:		Optional[Any]			=mode
								# Load data features from cache or dataset file
								lowerCamelCase__		:		Any			='''v2''' if args.version_2_with_negative else '''v1'''
								lowerCamelCase__		:		Optional[int]			=os.path.join(
								    cache_dir if cache_dir is not None else args.data_dir,  F'''cached_{mode.value}_{tokenizer.__class__.__name__}_{args.max_seq_length}_{version_tag}''',  )

								# Make sure only the first process in distributed training processes the dataset,
								# and the others will use the cache.
								lowerCamelCase__		:		Optional[Any]			=cached_features_file + '''.lock'''
								with FileLock(lowerCamelCase     ):
											if os.path.exists(lowerCamelCase     ) and not args.overwrite_cache:
														lowerCamelCase__		:		Tuple			=time.time()
														lowerCamelCase__		:		str			=torch.load(lowerCamelCase     )

														# Legacy cache files have only features, while new cache files
														# will have dataset and examples also.
														lowerCamelCase__		:		int			=self.old_features['''features''']
														lowerCamelCase__		:		Optional[int]			=self.old_features.get('''dataset''',  lowerCamelCase     )
														lowerCamelCase__		:		int			=self.old_features.get('''examples''',  lowerCamelCase     )
														logger.info(
														    F'''Loading features from cached file {cached_features_file} [took %.3f s]''',  time.time() - start     )

														if self.dataset is None or self.examples is None:
																	logger.warning(
																	    F'''Deleting cached file {cached_features_file} will allow dataset and examples to be cached in'''
																	    ''' future run'''     )
											else:
														if mode == Split.dev:
																	lowerCamelCase__		:		Tuple			=self.processor.get_dev_examples(args.data_dir     )
														else:
																	lowerCamelCase__		:		Optional[int]			=self.processor.get_train_examples(args.data_dir     )

														lowerCamelCase__	,   lowerCamelCase__		:		List[str]			=squad_convert_examples_to_features(
														    examples=self.examples,  tokenizer=lowerCamelCase,  max_seq_length=args.max_seq_length,  doc_stride=args.doc_stride,  max_query_length=args.max_query_length,  is_training=mode == Split.train,  threads=args.threads,  return_dataset=lowerCamelCase,  )

														lowerCamelCase__		:		List[str]			=time.time()
														torch.save(
														    {'''features''': self.features, '''dataset''': self.dataset, '''examples''': self.examples},  lowerCamelCase,  )
														# ^ This seems to take a lot of time so I want to investigate why and how we can improve.
														logger.info(
														    F'''Saving features into cached file {cached_features_file} [took {time.time() - start:.3f} s]'''     )



					def __len__(       self							:  Optional[int]     )->					Dict:
								return len(self.features     )




					def __getitem__(       self							:  List[str],  lowerCamelCase							:  List[Any]     )->					Dict[str, torch.Tensor]:
								# Convert to Tensors and build dataset
								lowerCamelCase__		:		List[Any]			=self.features[i]

								lowerCamelCase__		:		List[Any]			=torch.tensor(feature.input_ids,  dtype=torch.long     )
								lowerCamelCase__		:		List[str]			=torch.tensor(feature.attention_mask,  dtype=torch.long     )
								lowerCamelCase__		:		List[Any]			=torch.tensor(feature.token_type_ids,  dtype=torch.long     )
								lowerCamelCase__		:		Optional[int]			=torch.tensor(feature.cls_index,  dtype=torch.long     )
								lowerCamelCase__		:		Optional[int]			=torch.tensor(feature.p_mask,  dtype=torch.float     )
								lowerCamelCase__		:		List[Any]			=torch.tensor(feature.is_impossible,  dtype=torch.float     )

								lowerCamelCase__		:		Optional[Any]			={
								    '''input_ids''': input_ids,
								    '''attention_mask''': attention_mask,
								    '''token_type_ids''': token_type_ids,
								}

								if self.args.model_type in ["xlm", "roberta", "distilbert", "camembert"]:
											del inputs["token_type_ids"]

								if self.args.model_type in ["xlnet", "xlm"]:
											inputs.update({'''cls_index''': cls_index, '''p_mask''': p_mask}     )
											if self.args.version_2_with_negative:
														inputs.update({'''is_impossible''': is_impossible}     )
											if self.is_language_sensitive:
														inputs.update({'''langs''': (torch.ones(input_ids.shape,  dtype=torch.intaa     ) * self.args.lang_id)}     )

								if self.mode == Split.train:
											lowerCamelCase__		:		str			=torch.tensor(feature.start_position,  dtype=torch.long     )
											lowerCamelCase__		:		int			=torch.tensor(feature.end_position,  dtype=torch.long     )
											inputs.update({'''start_positions''': start_positions, '''end_positions''': end_positions}     )

								return inputs




