semvec/pypi-packages huggingface dataset:
simple-text-processor 0.1.0
A lightweight utility for common text preparation tasks in ML and NLP.
License: MIT
Requires Python: >=3.6

SimpleTextProcessor

A lightweight utility library for quick text preparation in machine learning and NLP tasks.

This package provides simple functions for

Cleaning Removing punctuation, converting to lowercase, and handling special characters.

Vectorization Creating a simple Bag-of-Words (BoW) vector representation from a list of documents.

Installation

Since this package is small, it only requires numpy as a dependency for the vectorization function.

pip install simple-text-processor


Usage

1. Clean Text

from simple_text_processor import clean_text

text = Hello World! This is a Test sentence with some Numb3rs.
cleaned_text = clean_text(text)
print(cleaned_text)
# Output hello world this is a test sentence with some numb rs


2. Simple Bag-of-Words Vectorizer

from simple_text_processor import simple_vectorize

documents = [
    The sun is shining brightly.,
    A sunny day is a happy day.,
    The moon is out tonight.,
]

vectors, vocabulary = simple_vectorize(documents)

print(Vocabulary, vocabulary)
# Output Vocabulary {'the' 0, 'sun' 1, 'is' 2, 'shining' 3, 'brightly' 4, 'a' 5, 'sunny' 6, 'day' 7, 'happy' 8, 'moon' 9, 'out' 10, 'tonight' 11}

print(nVectors (BoW)n, vectors)
# Output (Numpy array of word counts)
# [[1 1 1 1 1 0 0 0 0 0 0 0]
#  [0 0 1 0 0 1 1 2 1 0 0 0]
#  [1 0 1 0 0 0 0 0 0 1 1 1]]
xugrid 0.14.3
Xarray extension for unstructured grids
License: MIT
Requires Python: >=3.10
Keywords: mesh, ugrid, unstructured grid, xarray

Xugrid
======

.. image:: https://img.shields.io/github/actions/workflow/status/deltares/xugrid/ci.yml
   :target: https://github.com/deltares/xugrid/actions?query=workflows%3Aci
.. image:: https://img.shields.io/codecov/c/github/deltares/xugrid.svg
   :target: https://app.codecov.io/gh/deltares/xugrid
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
   :target: https://github.com/psf/black
.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.10534099.svg
  :target: https://doi.org/10.5281/zenodo.10534099

**This is a work in progress.** `See documentation <https://deltares.github.io/xugrid/>`_.

Xarray extension to work with 2D unstructured grids, for data and topology
stored according to `UGRID conventions
<https://ugrid-conventions.github.io/ugrid-conventions>`_.

Processing structured data with xarray is convenient and efficient. The goal of
Xugrid is to extend this ease to unstructured grids.

.. code:: python

  import matplotlib.pyplot as plt
  import xugrid

  # Get some sample data as a xugrid UgridDataArray
  uda = xugrid.data.elevation_nl()

  # Get a cross-section
  section_y = 475_000.0
  section = uda.ugrid.sel(y=section_y)

  # Plot unstructured grid and cross section
  fig, (ax0, ax1) = plt.subplots(figsize=(22.6, 10), ncols=2)
  uda.ugrid.plot(ax=ax0, vmin=-20, vmax=90, cmap="terrain")
  ax0.axhline(y=section_y, color="red")
  section.plot(ax=ax1, x="mesh2d_face_x")

.. image:: https://raw.githubusercontent.com/Deltares/xugrid/main/docs/_static/xugrid-demo.png
  :target: https://github.com/deltares/xugrid

Installation
------------

Install via conda from the conda-forge channel:

.. code:: console

  conda install -c conda-forge xugrid

Or from the Python Package Index:

.. code:: console

  pip install xugrid

Documentation
-------------

.. image:: https://img.shields.io/github/actions/workflow/status/deltares/xugrid/ci.yml?style=flat-square
  :target: https://deltares.github.io/xugrid/