





from typing import TYPE_CHECKING

from ....utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_a						=   {
    "configuration_mctct": ["MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MCTCTConfig"],
    "feature_extraction_mctct": ["MCTCTFeatureExtractor"],
    "processing_mctct": ["MCTCTProcessor"],
}


try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_a						=   [
			    "MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST",
			    "MCTCTForCTC",
			    "MCTCTModel",
			    "MCTCTPreTrainedModel",
			]


if TYPE_CHECKING:
			from .configuration_mctct import MCTCT_PRETRAINED_CONFIG_ARCHIVE_MAP, MCTCTConfig
			from .feature_extraction_mctct import MCTCTFeatureExtractor
			from .processing_mctct import MCTCTProcessor

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_mctct import MCTCT_PRETRAINED_MODEL_ARCHIVE_LIST, MCTCTForCTC, MCTCTModel, MCTCTPreTrainedModel

else:
			import sys

			_a						=   _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)










import string
from math import logaa





def lowerCAmelCase__(__snake_case ,__snake_case							)       ->   int:







	'''simple docstring'''







	lowerCamelCase__              =	document.translate(
	    str.maketrans('''''' ,'''''' ,string.punctuation							)							).replace('''\n''' ,''''''							)
	lowerCamelCase__              =	document_without_punctuation.split(''' '''							)  # word tokenization
	return len([word for word in tokenize_document if word.lower() == term.lower()]							)





def lowerCAmelCase__(__snake_case ,__snake_case							)       ->   tuple[int, int]:







	'''simple docstring'''







	lowerCamelCase__              =	corpus.lower().translate(
	    str.maketrans('''''' ,'''''' ,string.punctuation							)							)  # strip all punctuation and replace it with ''
	lowerCamelCase__              =	corpus_without_punctuation.split('''\n'''							)
	lowerCamelCase__              =	term.lower()
	return (len([doc for doc in docs if term in doc]							), len(__snake_case							))





def lowerCAmelCase__(__snake_case ,__snake_case ,__snake_case=False							)       ->   float:







	'''simple docstring'''







	if smoothing:
		if n == 0:
			raise ValueError('''log10(0) is undefined.'''							)
		return round(1 + logaa(n / (1 + df)							) ,3							)

	if df == 0:
		raise ZeroDivisionError('''df must be > 0'''							)
	elif n == 0:
		raise ValueError('''log10(0) is undefined.'''							)
	return round(logaa(n / df							) ,3							)





def lowerCAmelCase__(__snake_case ,__snake_case							)       ->   float:







	'''simple docstring'''







	return round(tf * idf ,3							)



