Text Classification

Text Classification

With Hyperscience’s Text Classification feature, you can train a model to classify freeform text in documents, emails, and more. This feature allows you to analyze and organize unstructured text by user intent, sentiment, topic, or any custom labels based on your own business rules.

For example, you can use the Text Classification feature to:

Text Classification in v38 and above

We’ve made significant changes to Text Classification since it was first introduced in v34. This section gives an overview of how the feature works in v38+ and the limitations that still exist.

How it works

If you would like to use Text Classification, Hyperscience provides you with a flow that you can use to classify text from a specific type of document. This flow contains the blocks needed to make Text Classification work:

You also can request that a Custom Supervision Block be included in your flow, which will allow your keyers to add or edit classifications manually.

As mentioned previously, each submission can have more than one class from a single dataset assigned to it. In earlier versions, multiple Text Classification Blocks were required to assign multiple classes from a single dataset.

Limitations in v38 and above

Setting up and using Text Classification

1.  Obtain the Text Classification flow from Hyperscience.

If you are interested in using Text Classification, reach out to your Hyperscience representative to discuss your intended use of the feature. If the feature meets your needs, your representative will share a file containing the code for a Text Classification flow.

2.  Create a CSV or ZIP file with training data, if you haven’t already.

To train the Text Classification model, you need to provide a CSV or ZIP file that contains your training data. The Text Classification model will use this training data to learn how to classify text samples from the training set.

You can download a sample CSV or ZIP to use to format your training data. To do so:

  1. Go to Library 4989; Models, and click on Text Classification Models in the drop-down list at the top of the page.
  2. Click Create New Dataset.
  3. Enter text in the Training Dataset Name text box.
  4. Click on the .CSV or .ZIP tab, depending on how you would like to upload your training data.
  5. Click on Download Sample .csv or Download Sample .ZIP.

CSV file

The CSV file needs to have two columns:

ZIP file

The ZIP file needs to have:

Guidelines

When adding content to your CSV or ZIP file, keep the following guidelines in mind:

3.  Import the training dataset and obtain its source UUID.

  1. Go to Library 4989; Models, and click on Text Classification Models in the drop-down list at the top of the page.
  2. Click Import Dataset.
  3. Do one of the following:
    • Drag and drop the CSV or ZIP file containing your training data into the box provided.
    • Click Choose File, find the CSV or ZIP file on your machine, and open it.
  4. Click Import.

After you import the dataset, the system creates a Text Classification model. You can view the details page for this model by clicking on the name of the dataset in the Text Classification Models view of the Models page.

  1. Copy the dataset’s Source UUID value in the Text Classification Models view of the Models page. Save this value, as you will need to enter it in the Text Classification Block’s settings in the next step.

4.  Import the provided flow and enter the source UUID of the dataset.

  1. In the application, import the JSON file for the flow.

Flow Studio opens to show the blocks in your imported flow. 2. Click on the Text Classification Block, and enter the source UUID you obtained in the previous step in the Text Classification Source UUID field. 3. Click Save.

After you’ve finished this step, the model is connected to the flow. You can deploy the flow and send submissions to it.

5.  Process submissions with the flow and view their classifications.

You can now use your Text Classification flow to process submissions. To learn how to create submissions with a specific flow, see How a File Becomes a Submission.

For each submission, the application uses the model to apply a class or classes to it. If it cannot classify the document with high confidence, the system can create a Custom Supervision task so a keyer can apply the correct classification to the text.

To view the classification applied by the machine or a keyer:

  1. On the Submissions page, find a submission that was processed through your Text Classification flow, and click on its Submission ID.
  2. Click Actions, and then click View Transformed Output.
  3. Search for the predictions element of the output, and find the class or classes applied to the submission.

Managing training data

You cannot add or delete training documents from a dataset. If you need to change the training documents in a dataset, create a new dataset with the training documents you would like to include.

Editing the classes assigned to a document

You can change the classes assigned to training documents. To do so:

  1. Go to Library 4989; Models, and click on Text Classification Models in the drop-down list at the top of the page.
  2. Find the dataset containing the classes you want to edit, and click on its name.
  3. In the Training Documents card at the bottom of the page, click Edit Annotations for the training document whose class or classes you want to edit.
  4. Select a new class or classes for the training document in the drop-down list in the right-hand sidebar, and click Complete Task.

After updating the training data, we recommend re-training the model by clicking Run Training on the details page for the dataset.