Skip to main content

TFIDF Transformer Afiniti

A package for performing TF-IDF transformation on text data. This project developing for an assessment:

Create a framework that does tf-idf transformation, you can use sklearn's tfidf function. Keep the following in mind

  • Handle Edge Cases : what happens when new text data arrives
  • Create Unit Tests : check failure scenarios
  • Add Docstrings : assume you will hand this code to some other SWE
  • Obey Engineering Best Practices
  • Use necessary inheritances

Create a (pypi) package out of this framework.

Installation

Use the package manager pip to install.

pip install tfidf-transformer-afiniti

Usage

from tfidf_transformer_afiniti.main import TfidfFramework

framework = TfidfFramework()

# Append some data to the data list
data = ["This is the first document.", "This document is the second document.", "And this is the third one."]
for d in data:
    framework.append_data(d)

# Print the tf-idf matrix
print(framework.tfidf_matrix.toarray())

# Add new one
new_data = "this is a new test document"
framework.append_data(new_data)
# Print the tf-idf matrix
print(framework.tfidf_matrix.toarray())

# Add new list
new_list_data = ["And this is the realy fifth one.","And this is the finaly sixth one."]  
framework.append_list_data(new_list_data)
# Print the tf-idf matrix
print(framework.tfidf_matrix.toarray())

Usage

python -m unittest tfidf_transformer_afiniti/tfidf_test.py

Metadata

Release files for tfidf-transformer-afiniti 0.4

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

Built distribution (wheel)

Table of built distributions (wheels) for tfidf-transformer-afiniti 0.4
File Interpreter ABI Platform Actions
tfidf_transformer_afiniti-0.4-py3-none-any.whl Python 3 none any Details for tfidf_transformer_afiniti-0.4-py3-none-any.whl

Release files / tfidf_transformer_afiniti-0.4-py3-none-any.whl

Download URL tfidf_transformer_afiniti-0.4-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f7d0b6a31bb80dbde99473a236fc58144b1b80c35c2f9d977e943e464369319
BLAKE2b-256 checksum
How to use checksums
15eae7909c869da6ba6924528b554d62433d95a15aed11f24c6f7331af0a956b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.12

Security for tfidf-transformer-afiniti 0.4

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.

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