Skip to main content

NALP: Natural Adversarial Language Processing

Latest release Open issues License

Welcome to NALP.

Have you ever wanted to create natural text from raw sources? If yes, NALP is for you! This package is an innovative way of dealing with natural language processing and adversarial learning. From bottom to top, from embeddings to neural networks, we will foster all research related to this new trend.

Use NALP if you need a library or wish to:

  • Create your embeddings;
  • Design or use pre-loaded state-of-art neural networks;
  • Mix-and-match different strategies to solve your problem;
  • Because it is cool to play with text.

Read the docs at nalp.readthedocs.io.

NALP 3.0.2 requires Python 3.11+ and is tested on Python 3.11 through 3.13.


Package guidelines

  1. The very first information you need is in the very next section.
  2. Installing is also easy if you wish to read the code and bump yourself into, follow along.
  3. Note that there might be some additional steps in order to use our solutions.
  4. If there is a problem, please do not hesitate, call us.

Getting started: 60 seconds with NALP

First of all. We have examples. Yes, they are commented. Just browse to examples/, chose your subpackage, and follow the example. We have high-level examples for most tasks we could think of.

Alternatively, if you wish to learn even more, please take a minute:

NALP is based on the following structure, and you should pay attention to its tree:

- nalp
    - core
        - corpus
        - dataset
        - encoder
        - model
    - corpus
        - audio
        - sentence
        - text
    - datasets
        - image
        - language_modeling
    - encoders
        - integer
        - word2vec
    - models
        - discriminators
            - conv
            - embedded_text
            - linear
            - lstm
            - text
        - generators
            - bi_lstm
            - conv
            - gru
            - gumbel_lstm
            - gumbel_rmc
            - linear
            - lstm
            - rmc
            - rnn
            - stacked_rnn
        - layers
            - gumbel_softmax
            - multi_head_attention
            - relational_memory_cell
        - dcgan
        - gan
        - gsgan
        - maligan
        - relgan
        - seqgan
        - wgan
    - utils
        - constants
        - loader
        - logging
        - preprocess

Core

The core is the core. Essentially, it is the parent of everything. You should find parent classes defining the basis of our structure. They should provide variables and methods that will help to construct other modules.

Corpus

Every pipeline has its first step, right? The corpus package serves as a basic class to load raw text, audio and sentences.

Datasets

Because we need data, right? Datasets are composed of classes and methods that allow preparing data for further neural networks.

Encoders

Text or Numbers? Encodings are used to make embeddings. Embeddings are used to feed into neural networks. Remember that networks cannot read raw text; therefore, you might want to pre-encode your data using well-known encoders.

Models

Each neural network architecture is defined in this package. From naïve RNNs to BiLSTMs, from GANs to TextGANs, you can use whatever suits your needs.

Utils

This is a utility package. Common things shared across the application should be implemented here. It is better to implement once and use it as you wish than re-implementing the same thing over and over again.


Installation

NALP is published on PyPI. Add it to a project managed by uv with:

uv add nalp

For a consumer installation in an existing Python environment, pip is also supported:

pip install nalp

Development

Clone the repository, then use the locked uv environment for all project tasks:

git clone https://github.com/gugarosa/nalp.git
cd nalp
uv sync --locked
uv run pytest
uv run pre-commit run --all-files
uv build

Source changes follow the NALP conventions, including Google-style public docstrings, explicit I/O contracts, and consistent 120-column tooling.

After a version bump is merged into main and CI succeeds, the release workflow builds and checks the distributions, publishes them to PyPI, and creates the matching GitHub release. Commits whose version tag already exists do not publish another release. Publishing a GitHub release manually remains supported.


Environment configuration

Note that sometimes, there is a need for additional implementation. If needed, from here, you will be the one to know all of its details.

Ubuntu

No specific additional commands needed.

Windows

No specific additional commands needed.

MacOS

No specific additional commands needed.


Support

We know that we do our best, but it is inevitable to acknowledge that we make mistakes. If you ever need to report a bug, report a problem, talk to us, please do so! We will be available at our bests at this repository or gustavo.rosa@unesp.br.


Metadata

Release files for nalp 3.0.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 nalp 3.0.2
File Size Uploaded Provenance Actions
nalp-3.0.2.tar.gz 48.8 kB Without provenance Details for nalp-3.0.2.tar.gz

Built distribution (wheel)

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

Total release size: 113.7 kB

Release files / nalp-3.0.2.tar.gz

Download URL nalp-3.0.2.tar.gz
Size 48.8 kB
Tags Source
SHA-256 checksum
How to use checksums
df8b120c9e33aa0d7533ef2718c68fe4082e06810b87f69b7bed8b7ef47b2397
BLAKE2b-256 checksum
How to use checksums
4df9eb5f52df8e168ba9dd6d8543d05c2a5fb2303f4301156664be78c3c0aebe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / nalp-3.0.2-py3-none-any.whl

Download URL nalp-3.0.2-py3-none-any.whl
Size 64.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27c58f22d6005bd7331fa5eadc0bdb21b69629415a1f4f0dfc2ca4a39d99fd2d
BLAKE2b-256 checksum
How to use checksums
89d08402c52822e9d7daf187417b8f24ee02313cfc3f785267fc41c64e05172c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for nalp 3.0.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