Skip to main content

Molda

Molda is a sci-kit learn inspired Python library for text vectorization of corpora. It is adapted to work in pipelines and numpy arrays.

The current version supports many algorithms denoted by the following classes:

  • TTestVectorizer
  • TficfVectorizer
  • ObservedExpectedVectorizer
  • LTUVectorizer
  • Gref94Vectorizer
  • ATCVectorizer

These classes are based on the sci-kit learn's CountVectorizer.

You need to instantiate the vectorizer with the parameters you need, fit and apply the transformations. Here is an example:

from Tficf import TficfVectorizer

corpus = np.array([
    "Even though I enjoyed watching that, This is bullshit",
    "I really enjoyed watching that",
    "I resent watching this video"
])

y = [1, 0, 1]

v = TficfVectorizer()
v.fit(corpus, y)
v.transform(['Hello, there'])

Also, you can include the vectorizer in a pipeline, like in the following example:

pipe = Pipeline([
            ('vectorizer', TficfVectorizer()),
            ('scaler', StandardScaler(with_mean=False)),
            ('estimator', SVC())
        ])
pipe.fit(corpus, y)
pipe.score(corpus, y)
pipe.predict(['This is wonderful'])

Molda works with Pandas DataFrames too:

df = pd.read_csv('../irony-labeled.csv')
df = df.dropna()

corpus_ = df['comment_text'].to_numpy()
y_ = df['label'].to_numpy()

v = TficfVectorizer()
v.fit(corpus_, y_)
v.transform(['Hello, there', 'Goodbye'])

With love from Sigmoid.

We are open for feedback. Please send your impression to vladimir.stojoc@gmail.com

Metadata

Release files for molda 0.1.2

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

Source distribution (sdist)

Source distribution for molda 0.1.2
File Size Uploaded Provenance Actions
molda-0.1.2.tar.gz 15.2 kB Without provenance Details for molda-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for molda 0.1.2
File Interpreter ABI Platform Actions
molda-0.1.2-py3-none-any.whl Python 3 none any Details for molda-0.1.2-py3-none-any.whl

Total release size: 38.3 kB

Release files / molda-0.1.2.tar.gz

Download URL molda-0.1.2.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b95a25dea0cb813ac33b3afdf8fd3de7ad334000c1de2abb586577babf3029f3
BLAKE2b-256 checksum
How to use checksums
59ec8c8e27218d861450917cfc81afbdc0521091be34da3ac0e5d2ee6e15a09e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.2

Release files / molda-0.1.2-py3-none-any.whl

Download URL molda-0.1.2-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7617192ab291e3db475d11532e2163163a85928a19e64c2c6217469a7542162f
BLAKE2b-256 checksum
How to use checksums
c4ce5b7a5be136f5268e8a341a4755f5cc5816416d9dee11fd75b82f2bfe060e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.2

Security for molda 0.1.2

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