OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Evaluation & Observability

Artificial Adversary

Artificial Adversary is a Python library that generates adversarial text examples and measures how binary machine-learning text classifiers respond to them.

Independent OpenViST project profile, based on linked sources.

Artificial Adversary — Black-box robustness checks for binary text classifiers
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when you can supply positive-class text samples and a prediction function, and want to examine classifier behavior under generic text changes without exposing model internals.

Who it is for

  • Machine-learning practitioners testing text-classifier robustness against cosmetic text obfuscation.
  • Teams preparing training datasets with generated examples resembling text attacks.

Documented uses

  • Generate altered versions of positive-class text samples using character- and word-level changes.
  • Measure classifier responses to individual and grouped attack types.
  • Create adversarial examples for possible dataset augmentation.
Before you choose

Requirements & limits

The repository is public and identifies the project as MIT-licensed. The README documents installation with pip and a TextBlob corpus-download command.

  • The attack method uses generic changes and treats the model as a black box.
  • The attack interface expects a prediction function that returns a binary label.
  • Generated examples may sometimes be identical to their originals.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Generate examples and measure classifier responses

Use the library's documented Python interface to generate altered text and obtain attack metrics for a binary classifier.

Before you start

  • Python environment with the Adversary package installed using pip install Adversary.
  • TextBlob corpora downloaded with python -m textblob.download_corpora.
  • Original positive-class text samples and a prediction function mapping each input string to label 0 or 1.

Steps

  1. Import Adversary and create an instance.

  2. Pass the original strings to generate to produce altered text examples.

  3. Pass the originals, generated examples, and model prediction function to attack.

Expected outcome

The generation method returns tuples containing altered text, the applied attacks, and the original-text index; the attack method returns DataFrames with metrics for individual and grouped attacks.

Guide limitations

  • Only positive-class instances should be supplied to these functions.
  • Probabilistic sampling and length heuristics can produce examples that do not differ from the original.
  • The README describes the returned metrics but does not define a specific interpretation threshold.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
15 November 2026
Original website title
airbnb/artificial-adversary · Official homepage title · retained in its source language