prebuilt.essay_grading¶

Essay Grading - TODO: Add brief description.

TODO: Add detailed description of module functionality

Examples

Basic usage:

from haive.essay_grading import module_function

# TODO: Add example

Classes¶

BaseLLMConfig

Placeholder for base LLM configuration.

FactCheckResult

dict() -> new empty dictionary

JournamlsimReviewAgent

Agent for reviewing the grammar and bias of an article.

State

dict() -> new empty dictionary

SystemAction

dict() -> new empty dictionary

Functions¶

categorize_user_input(state)

This node handles the categorization of the user input to identify the intended actions.

chunk_large_text(text)

Split large text into manageable chunks.

fact_check_article(article_text[, chunks])

Fact-check the given text by identifying factual inaccuracies, misleading information, unsupported claims, or vague language.

fact_checking_node(state)

Fact Checking Node.

get_or_create_chunks(state)

This function gets the article text from the state and splits it into manageable chunks.

get_user_actions(input_text)

Identify the user's intended actions based on their input.

grammar_and_bias_review_node(state)

Grammar And Bias Review Node.

grammary_and_bias_analysis_article(article_text[, chunks])

Review the given article text for grammar, spelling, punctuation, and bias.

quote_extraction_article(article_text[, chunks])

Extract direct quotes from the given article text.

quote_extraction_node(state)

Quote Extraction Node.

route(state)

Route.

search_and_summarize(keyword)

Search for keyword and summarize results.

summarization_node(state)

This node generates a summary of the article text.

summarize_article(article_text, chunks)

Summarize the article.

tone_analysis_article(article_text[, chunks])

Analyze the tones of the given article text.

tone_analysis_node(state)

Tone Analysis Node.

Package Contents¶

class prebuilt.essay_grading.BaseLLMConfig¶

Placeholder for base LLM configuration.

class prebuilt.essay_grading.FactCheckResult¶

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

class prebuilt.essay_grading.JournamlsimReviewAgent(llm)¶

Bases: haive.agents.base.agent.Agent

Agent for reviewing the grammar and bias of an article.

Init .

Parameters:

llm (BaseLLMConfig) – [TODO: Add description]

setup_workflow()¶

Setup Workflow.

class prebuilt.essay_grading.State¶

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

class prebuilt.essay_grading.SystemAction¶

Bases: TypedDict

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s

(key, value) pairs

dict(iterable) -> new dictionary initialized as if via:

d = {} for k, v in iterable:

d[k] = v

dict(**kwargs) -> new dictionary initialized with the name=value pairs

in the keyword argument list. For example: dict(one=1, two=2)

Initialize self. See help(type(self)) for accurate signature.

prebuilt.essay_grading.categorize_user_input(state)¶

This node handles the categorization of the user input to identify the intended actions.

Parameters:

state (State)

Return type:

State

prebuilt.essay_grading.chunk_large_text(text)¶

Split large text into manageable chunks.

Parameters:

text (str)

Return type:

List[str]

prebuilt.essay_grading.fact_check_article(article_text, chunks=None)¶

Fact-check the given text by identifying factual inaccuracies, misleading information, unsupported claims, or vague language.

Parameters:

article_text (str)

prebuilt.essay_grading.fact_checking_node(state)¶

Fact Checking Node.

Parameters:

state (State) – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

prebuilt.essay_grading.get_or_create_chunks(state)¶

This function gets the article text from the state and splits it into manageable chunks. The chunks are stored in the state to avoid recomputing them multiple times.

Parameters:

state (State)

prebuilt.essay_grading.get_user_actions(input_text)¶

Identify the user’s intended actions based on their input.

Parameters:

input_text (str)

Return type:

List[str]

prebuilt.essay_grading.grammar_and_bias_review_node(state)¶

Grammar And Bias Review Node.

Parameters:

state (State) – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

prebuilt.essay_grading.grammary_and_bias_analysis_article(article_text, chunks=None)¶

Review the given article text for grammar, spelling, punctuation, and bias.

Parameters:

article_text (str)

prebuilt.essay_grading.quote_extraction_article(article_text, chunks=None)¶

Extract direct quotes from the given article text.

Parameters:

article_text (str)

prebuilt.essay_grading.quote_extraction_node(state)¶

Quote Extraction Node.

Parameters:

state (State) – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

prebuilt.essay_grading.route(state)¶

Route.

Parameters:

state (State) – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

prebuilt.essay_grading.search_and_summarize(keyword)¶

Search for keyword and summarize results.

Parameters:

keyword (str)

Return type:

str

prebuilt.essay_grading.summarization_node(state)¶

This node generates a summary of the article text.

prebuilt.essay_grading.summarize_article(article_text, chunks)¶

Summarize the article.

Parameters:
  • article_text (str)

  • chunks (List[str])

Return type:

str

prebuilt.essay_grading.tone_analysis_article(article_text, chunks=None)¶

Analyze the tones of the given article text.

Parameters:

article_text (str)

prebuilt.essay_grading.tone_analysis_node(state)¶

Tone Analysis Node.

Parameters:

state (State) – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO