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

Submodules¶

Attributes¶

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(→ List[str])

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(→ List[str])

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(→ str)

Route.

search_and_summarize(→ str)

Search for keyword and summarize results.

summarization_node(state)

This node generates a summary of the article text.

summarize_article(→ str)

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)

result: List[dict]¶
class prebuilt.essay_grading.JournamlsimReviewAgent(llm: BaseLLMConfig)¶

Bases: haive.agents.base.agent.Agent

Agent for reviewing the grammar and bias of an article.

setup_workflow()¶

Setup Workflow.

graph = None¶
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)

actions: List[str]¶
article_text: str¶
chunks: List[str]¶
current_query: str¶
fact_check_result: List[dict]¶
grammar_and_bias_review_result: List[str]¶
quote_extraction_result: List[str]¶
summary_result: str¶
tone_analysis_result: List[str]¶
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)

actions: List[str]¶
prebuilt.essay_grading.categorize_user_input(state: State) State¶

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

prebuilt.essay_grading.chunk_large_text(text: str) List[str]¶

Split large text into manageable chunks.

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

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

prebuilt.essay_grading.fact_checking_node(state: State) State¶

Fact Checking Node.

Parameters:

state – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

prebuilt.essay_grading.get_or_create_chunks(state: 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.

prebuilt.essay_grading.get_user_actions(input_text: str) List[str]¶

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

prebuilt.essay_grading.grammar_and_bias_review_node(state: State) State¶

Grammar And Bias Review Node.

Parameters:

state – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

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

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

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

Extract direct quotes from the given article text.

prebuilt.essay_grading.quote_extraction_node(state: State) State¶

Quote Extraction Node.

Parameters:

state – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

prebuilt.essay_grading.route(state: State) str¶

Route.

Parameters:

state – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

prebuilt.essay_grading.search_and_summarize(keyword: str) str¶

Search for keyword and summarize results.

prebuilt.essay_grading.summarization_node(state)¶

This node generates a summary of the article text.

prebuilt.essay_grading.summarize_article(article_text: str, chunks: List[str]) str¶

Summarize the article.

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

Analyze the tones of the given article text.

prebuilt.essay_grading.tone_analysis_node(state: State) State¶

Tone Analysis Node.

Parameters:

state – [TODO: Add description]

Returns:

Add return description]

Return type:

[TODO

prebuilt.essay_grading.action_pipeline¶
prebuilt.essay_grading.action_prompt¶
prebuilt.essay_grading.fact_checking_pipeline¶
prebuilt.essay_grading.fact_checking_prompt¶
prebuilt.essay_grading.grammar_and_bias_review¶
prebuilt.essay_grading.llm = None¶
prebuilt.essay_grading.quote_extraction_pipeline¶
prebuilt.essay_grading.quote_extraction_prompt¶
prebuilt.essay_grading.review_prompt¶
prebuilt.essay_grading.routes¶
prebuilt.essay_grading.structured_output_llm¶
prebuilt.essay_grading.tone_analysis_prompt¶
prebuilt.essay_grading.tone_pipeline¶
prebuilt.essay_grading.user_actions¶
prebuilt.essay_grading.user_inputs = ['Can you summarize this article for me?', "I'm not sure about the accuracy of this article. Can...¶