Skip to main content

Post-processing-library-llm

Installation

You can install Post-processing-library-llm library using pip:

pip install Post-processing-library-llm

Named Entity Recognition (NER)

In this example, we’ll use the Post-processing-library-llm to perform NER on a set of documents and evaluate the results.

from post_processing_library_llm.ner import ner

# Define ground truth and prediction dictionaries
truth_dict = {
    'airplane': ["Boeing B-52 Stratofortress", "predator drone"]
}
prediction_dict = {
    'airplane': ["drone", "sparrow"]
}

# Perform NER and get results
ner_results = ner.named_entity_recognition(truth_dict, prediction_dict, fuzzy_threshold)

# Print the results
print(ner_results)
NER Output:

{‘Correct Entities’: 1, ‘Missed Entities’: 1, ‘False Positive Entities’: 1}

Text Matching Example

Here’s an example of how to perform Text Matching using the Post-processing-library-llm library:

Text Matching involves comparing two text strings and determining how similar or different they are. The post_processing_library_llm provides various text matching algorithms, including direct matching, token overlap, and cosine similarity, and gives all the metrics as output.

In this example, we’ll use the Text Matcher to compare a list of ground truth texts with predicted texts and calculate matching metrics.

from post_processing_library_llm.get_metrics import TextMatcher

# Define ground truth and prediction lists
truth_list = ["this is a ball", "cat", "Toyota Camry"]
pred_list = ["this is a ball", "Ford Mustang", "Toyota Corolla"]

# Perform text matching with cosine similarity
metrics = text_matcher.match_texts(truth_list, pred_list, match_type='cosine_similarity')

# Print the metrics
print(metrics)
Text Matching Output:

{‘Precision’: 1.0, ‘Recall’: 0.3333333333333333, ‘Specificity’: nan, ‘F1 Score’: 0.5, ‘Negative Predictive Value (NPV)’: 0.0, ‘False Positive Rate (FPR)’: nan, ‘False Negative Rate (FNR)’: 0.6666666666666666, ‘False Discovery Rate (FDR)’: 0.0, ‘Accuracy’: 0.3333333333333333, ‘True Positive Rate (TPR)’: 0.3333333333333333, ‘Positive Predictive Value (PPV)’: 1.0, ‘True Negative Rate (TNR)’: nan, ‘Macro Average Precision’: 0.5, ‘Macro Average Recall’: 0.16666666666666666, ‘Macro Average F1 Score’: 0.25, ‘Weighted Average Precision’: 1.0, ‘Weighted Average Recall’: 0.3333333333333333, ‘Weighted Average F1 Score’: 0.5}

Metadata

Release files for post-processing-library-llm 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for post-processing-library-llm 0.0.5
File Size Uploaded Provenance Actions
post_processing_library_llm-0.0.5.tar.gz 4.5 kB Without provenance Details for post_processing_library_llm-0.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for post-processing-library-llm 0.0.5
File Interpreter ABI Platform Actions
post_processing_library_llm-0.0.5-py3-none-any.whl Python 3 none any Details for post_processing_library_llm-0.0.5-py3-none-any.whl

Total release size: 9.9 kB

Release files / post_processing_library_llm-0.0.5.tar.gz

Download URL post_processing_library_llm-0.0.5.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
81021d8f836fe3b49b2671a7000685024046cd84a113634da5238aac729797c9
BLAKE2b-256 checksum
How to use checksums
bc8c8f09f17780ece977059d9a667820364176056d2e06780cf32b03b847981e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Release files / post_processing_library_llm-0.0.5-py3-none-any.whl

Download URL post_processing_library_llm-0.0.5-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
85fb09754c7d2aa3c2f8ad837e98b80e89391db5ecf1f785f36979189dba8331
BLAKE2b-256 checksum
How to use checksums
addd06941fe0c44cbc2eac90faa31bc7efc8be3784ef17a431d7d37b62660162
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.13

Security for post-processing-library-llm 0.0.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.5 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page