![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Automated Summary Scoring & Evaluation of Retained Text
This repository contains tools for evaluating the quality of summaries generated by LLMs.
View a live demo of the library here
Documentation is available here
All metrics are normalized to return scores between 0 and 1, where higher scores indicate better performance:
bert_model
parameter to specify the model to use for BERTScore calculation.All RAG metrics return scores between 0 and 1:
Basic installation:
pip install assert_llm_tools
Optional Dependencies:
For Amazon Bedrock support:
pip install "assert_llm_tools[bedrock]"
For OpenAI support:
pip install "assert_llm_tools[openai]"
To install all optional dependencies:
pip install "assert_llm_tools[all]"
from assert_llm_tools.core import evaluate_summary, evaluate_rag
from assert_llm_tools.utils import add_custom_stopwords
from assert_llm_tools.llm.config import LLMConfig
# Add custom stopwords
add_custom_stopwords(["this", "artificial", "intelligence"])
# Example text from an article
full_text = """
Artificial intelligence is rapidly transforming the world economy. Companies
are investing billions in AI research and development, leading to breakthroughs
in automation, data analysis, and decision-making processes. While this
technology offers immense benefits, it also raises concerns about job
displacement and ethical considerations.
"""
# Example summary
summary = """
AI is transforming the economy through major investments, bringing advances in
automation and analytics while raising job and ethical concerns.
"""
# Using OpenAI
config = LLMConfig(
provider="openai",
model_id="gpt-4",
api_key="your-api-key"
)
# Summary Evaluation Example
metrics = evaluate_summary(full_text, summary,
remove_stopwords=True,
metrics=["rouge", "bleu", "bert_score", "bart_score", "faithfulness", "topic_preservation", "redundancy", "conciseness"],
llm_config=config)
# RAG Evaluation Example
rag_metrics = evaluate_rag(query="What is the capital of France?",
context="Paris is the capital and largest city of France.",
answer="The capital of France is Paris.",
metrics=["context_relevance", "answer_accuracy", "completeness", "faithfulness","answer_attribution"],
llm_config=config)
# Print results
print(metrics)
print(rag_metrics)
MIT License
Copyright (c) 2024
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Automated Summary Scoring & Evaluation of Retained Text
We found that assert-llm-tools demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.