text_complexity_analyzer_cm.coh_metrix_indices.referential_cohesion_indices
index
/home/hans/Proyectos/Python/TextComplexityAnalyzerCM/text_complexity_analyzer_cm/coh_metrix_indices/referential_cohesion_indices.py

 
Modules
       
multiprocessing
spacy
statistics

 
Classes
       
builtins.object
ReferentialCohesionIndices

 
class ReferentialCohesionIndices(builtins.object)
    ReferentialCohesionIndices(nlp, language: str = 'es') -> None
 
This class will handle all operations to find the synthactic pattern density indices of a text according to Coh-Metrix.
 
  Methods defined here:
__init__(self, nlp, language: str = 'es') -> None
The constructor will initialize this object that calculates the synthactic pattern density indices for a specific language of those that are available.
 
Parameters:
nlp: The spacy model that corresponds to a language.
language(str): The language that the texts to process will have.
 
Returns:
None.
get_anaphore_overlap_adjacent_sentences(self, text: str, workers: int = -1) -> float
This method calculates the mean of the anaphore overlap for adjacent sentences in a text.
 
Parameters:
text(str): The text to be analyzed.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
 
Returns:
float: The mean mean of the anaphore overlap.
get_anaphore_overlap_all_sentences(self, text: str, workers: int = -1) -> float
This method calculates the mean of the anaphore overlap for all sentences in a text.
 
Parameters:
text(str): The text to be analyzed.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
 
Returns:
float: The mean mean of the anaphore overlap.
get_argument_overlap_adjacent_sentences(self, text: str, workers: int = -1) -> float
This method calculates the argument overlap for adjacent sentences in a text.
 
Parameters:
text(str): The text to be analyzed.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
 
Returns:
float: The mean argument overlap.
get_argument_overlap_all_sentences(self, text: str, workers: int = -1) -> float
This method calculates the argument overlap for all sentences in a text.
 
Parameters:
text(str): The text to be analyzed.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
 
Returns:
float: The mean argument overlap.
get_content_word_overlap_adjacent_sentences(self, text: str, workers: int = -1) -> float
This method calculates the mean and standard deviation of the content word overlap for adjacent sentences in a text.
 
Parameters:
text(str): The text to be analyzed.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
 
Returns:
float: The mean mean and standard deviation of the content word overlap.
get_content_word_overlap_all_sentences(self, text: str, workers: int = -1) -> text_complexity_analyzer_cm.utils.statistics_results.StatisticsResults
This method calculates the mean and standard deviation of the content word overlap for all sentences in a text.
 
Parameters:
text(str): The text to be analyzed.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
 
Returns:
StatisticsResults: The mean mean and standard deviation of the content word overlap.
get_noun_overlap_adjacent_sentences(self, text: str, workers: int = -1) -> float
This method calculates the noun overlap for adjacent sentences in a text.
 
Parameters:
text(str): The text to be analyzed.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
 
Returns:
float: The mean noun overlap.
get_noun_overlap_all_sentences(self, text: str, workers: int = -1) -> float
This method calculates the noun overlap for all sentences in a text.
 
Parameters:
text(str): The text to be analyzed.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
 
Returns:
float: The mean noun overlap.
get_stem_overlap_adjacent_sentences(self, text: str, workers: int = -1) -> float
This method calculates the stem overlap for adjacent sentences in a text.
 
Parameters:
text(str): The text to be analyzed.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
 
Returns:
float: The mean stem overlap.
get_stem_overlap_all_sentences(self, text: str, workers: int = -1) -> float
This method calculates the stem overlap for all sentences in a text.
 
Parameters:
text(str): The text to be analyzed.
workers(int): Amount of threads that will complete this operation. If it's -1 then all cpu cores will be used.
 
Returns:
float: The mean stem overlap.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
analyze_anaphore_overlap(prev_sentence: spacy.tokens.span.Span, cur_sentence: spacy.tokens.span.Span, language: str = 'es') -> int
This function analyzes whether or not there's anaphore overlap between two sentences.
 
Parameters:
prev_sentence(Span): The previous sentence to analyze.
cur_sentence(Span): The current sentence to analyze.
language(str): The language of the sentences.
 
Returns:
int: 1 if there's overlap between the two sentences and 0 if no.
analyze_argument_overlap(prev_sentence: spacy.tokens.span.Span, cur_sentence: spacy.tokens.span.Span, language: str = 'es') -> int
This function analyzes whether or not there's argument overlap between two sentences.
 
Parameters:
prev_sentence(Span): The previous sentence to analyze.
cur_sentence(Span): The current sentence to analyze.
language(str): The language of the sentences.
 
Returns:
int: 1 if there's overlap between the two sentences and 0 if no.
analyze_content_word_overlap(prev_sentence: spacy.tokens.span.Span, cur_sentence: spacy.tokens.span.Span, language='es') -> float
This function calculates the proportional content word overlap between two sentences.
 
Parameters:
prev_sentence(Span): The previous sentence to analyze.
cur_sentence(Span): The current sentence to analyze.
language(str): The language of the sentences.
 
Returns:
float: Proportion of tokens that overlap between the current and previous sentences
analyze_noun_overlap(prev_sentence: spacy.tokens.span.Span, cur_sentence: spacy.tokens.span.Span, language: str = 'es') -> int
This function analyzes whether or not there's noun overlap between two sentences for a language.
 
Parameters:
prev_sentence(Span): The previous sentence to analyze.
cur_sentence(Span): The current sentence to analyze.
language(str): The language of the sentences.
 
Returns:
int: 1 if there's overlap between the two sentences and 0 if no.
analyze_stem_overlap(prev_sentence: spacy.tokens.span.Span, cur_sentence: spacy.tokens.span.Span, language: str = 'es') -> int
This function analyzes whether or not there's stem overlap between two sentences.
 
Parameters:
prev_sentence(Span): The previous sentence to analyze.
cur_sentence(Span): The current sentence to analyze.
language(str): The language of the sentences.
 
Returns:
int: 1 if there's overlap between the two sentences and 0 if no.

 
Data
        ACCEPTED_LANGUAGES = {'es': 'es_core_news_lg'}
Callable = typing.Callable
List = typing.List