Overview of the BioChatter Benchmark Module
mainpytest framework, with configuration managed in conftest.py.repository·main·Indexed 42 days ago
https://github.com/biocypher/biochatterA community-driven Python library (v0.14.2) designed to connect biomedical applications to conversational AI. It enables the use of generative AI models within the biomedical domain and includes a benchmark module for testing models against specific test cases using a matrix-based approach and the pytest framework.
pytest framework, with configuration managed in conftest.py.BioChatter is a Python framework designed for deploying, testing, and evaluating conversational AI models within the biomedical domain. It provides a generic backend library that connects biomedical applications to conversational AI, enabling the use of diverse models and auxiliary technologies.
Key characteristics include:
The BioChatter benchmark provides living results for evaluating models across various tasks. The results are categorized into three primary views to help developers assess model performance:
For detailed methodology on how these benchmarks are conducted, refer to the benchmarking documentation and the developer docs.
Large Language Models (LLMs) like GPT-3.5 or GPT-4 can sometimes struggle with the directionality of relationships in a Knowledge Graph (e.g., confusing (Crime)-[:INVESTIGATED_BY]->(Officer) with (Officer)-[:INVESTIGATED_BY]->(Crime)).
BioChatter compensates for this by using the source and target annotations from the BioCypher YAML schema definition. The prompts.py module uses this metadata to only propose relationship patterns that actually exist in the KG, effectively constraining the LLM to valid edge directions.
biochatter.podcast module is used to handle the generation of podcasts from text inputs. This module serves as the primary interface for converting textual content into podcast-style audio formats.BioChatter evaluates LLM responses based on five core validation requirements, tested both with and without Retrieval-Augmented Generation (RAG). These requirements are applied to tasks involving personalized interventional medicine in geroscience:
BioChatter Light uses a modular architecture based on the Streamlit framework, allowing you to add new tabs or customize existing ones.
To add new functionality:
components/panels/project.py for custom project-related tabs).components/config.py) to allow them to be toggled via environment variables.Each tab typically requires implementing Streamlit components like columns, buttons, and text fields.
BioChatter manages LLM interactions through the Conversation class and its specialized child classes located in the llm_connect.py module. These child classes (e.g., GptConversation, AnthropicConversation, GeminiConversation) abstract away the specific API differences between different LLM providers.
A conversation is built by managing a history of messages, including system messages, user messages, and AI responses. The conversation object handles the orchestration of a 'primary model' and an optional 'correcting agent' based on the prompts provided during initialization.
from biochatter.llm_connect import GptConversation
conversation = GptConversation(
model_name="gpt-3.5-turbo",
prompts={},
)Text extraction benchmarks evaluate the ability of LLMs to extract specific structured information from unstructured documents.
Key extraction tasks include:
RAG benchmarks in BioChatter test the ability of LLMs to either generate answers to questions using a RAG agent or to judge the relevance of specific text fragments to a question.
Two testing modes are used: