oneai-tagger

Tag files using OneAI. Just load content into Steamship and apply OneAI's library of skills..

Using

Tagger Plugins add annotations to text that can be queried and composed later.

Blockifiers convert data into Steamship’s native Block format.

Importer Plugins add annotations to text that can be queried and composed later.

Use them when writing Packages to help you work with data of different types.

Links

from steamship import Steamship, File

client = Steamship(workspace="my-workspace-handle")

# Import a file to Steamship
with open("file.ext") as f:
  file = File.create(content=file.read())

# Create an instance of this blockifier
blockifier = client.use_plugin(
  'oneai-tagger'
)

# Blockify the file
task = file.blockify()
task.wait()
from steamship import Steamship, File

client = Steamship(workspace="my-workspace-handle")

# Import a file to Steamship
with open("file.ext") as f:
  file = File.create(content=file.read())

# Create a blockifier. We'll assume Markdown here.
blockifier = client.use_plugin(
  'markdown-blockifier-default'
)

# Blockify the file
task = file.blockify()

# Create an instance of this tagger.
tagger = client.use_plugin(
  'oneai-tagger'
)

# Tag the file
task = file.tag()

task.wait()
Pulled from the GitHub repository.
# OneAI Tagger Plugin - Steamship

This project contains a Steamship Tagger plugin that enables use of OneAI's text tagging pipeline.

## Configuration

This plugin must be configured with the following fields:

* `skills`     - A CSV list of One AI "skills" that produce tags

Example skills are:

* `entities` - Tags real-world objects, such as people, organizations, and time frames.
* `topics` - Tags text with relevant topics.
* `sentiment` - Tags text with phrases containing positive and negative sentiment: Output tags: `[POS, NEG]`
* `emotions` - Tags text with phrases describing emotion: Output tags: `[happiness, sadness, anger, surprise, fear]`
* `highlights` - Tags text with selected highlights: Output tags: `[highlight]`
* `keywords` - Tags text with selected keywords.
* `sentences` - Splits sentences by text.
* `action-items` - Tags text for action items.
* `article-topics` - Topics from an article
* `business-entities` - Business Entity labeling
* `names` - Names mentioned
* `numbers` - Numbers mentioned

## Usage

This example uses the `action-items` skill of OneAI.

To authenticate with Steamship, install the Steamship CLI with:

```bash
> npm install -g @steamship/cli
```

And then login with:

```bash
> ship login
```

```python
from steamship import Steamship, File, Block, Tag

PLUGIN_HANDLE = 'oneai-tagger'
PLUGIN_CONFIG = {
    "skills": 'action-items',
}

ship = Steamship()  # Without arguments, credentials in ~/.steamship.json will be used.
oneai_plugin_instance = ship.use_plugin(
    plugin_handle=PLUGIN_HANDLE,
    config=PLUGIN_CONFIG
)

file = File.create(
    client=ship,
    blocks=[Block.CreateRequest(text="YOUR_TEXT", tags=[Tag.CreateRequest(name="Hi")])]
)

tag_results = file.tag(plugin_instance=oneai_plugin_instance.handle)
tag_results.wait()

file = tag_results.output.file
for block in file.blocks:
    for tag in block.tags:
        text = block.text[tag.start_idx or 0:tag.end_idx or -1]
        print(f"[{tag.kind} / {tag.name}]\n{text}")
```

## Developing

Development instructions are located in [DEVELOPING.md](https://github.com/steamship-plugins/tagger-oneai/blob/main/DEVELOPING.md)

## Testing

Testing instructions are located in [TESTING.md](https://github.com/steamship-plugins/tagger-oneai/blob/main/TESTING.md)

## Deploying

Deployment instructions are located in [DEPLOYING.md](https://github.com/steamship-plugins/tagger-oneai/blob/main/DEPLOYING.md)

Steamship is building the fastest way to ship language AI.

Stop building and start shipping. Reach out to get onboarded.
Read More