Generate Text

Generate text for various purposes, such as summarizing information, answering questions, or creating natural language responses. Use the Prompt Template to guide the text generation. The $field_source_column notation specifies the source column and the $column_<column_name> notation specifies all other columns in your dataset.

Parameters

  • Destination Column: The column name that will hold the manipulated text. Defaults to manipulated_text.
  • LLM: The large language model used for text generation. Defaults to gpt-3.5-turbo.
  • Credential ID: The connector from your Mantium account. This is a required field.
  • String Template: The template that guides the manipulation of text. Defaults to empty string.

Usage

To use the Generate Text transformation, you will need to have a valid API key configured in Mantium for the third-party service (e.g., OpenAI) you want to use. If you don't have one, see the guide here

To use this Mantium Enrichment, follow these steps:

  1. Configure the Destination Column parameter by specifying the new name for the column that will hold the generated text.
  2. Configure the LLM Model parameter by selecting the LLM model to use for the text generation.
  3. Configure the Credential ID parameter by selecting the appropriate credential from the list of available credentials in your Mantium account.
  4. Add text in the StringTemplate field to provide details to the model on how to generate the text. See example below.
  5. Optional: Preview the transform to see how the generated text can look based on your data.
  6. Run the transformation by clicking the Save and Run Transforms button. The resulting dataset will have a new column with the specified name containing the generated text data.

Example 1: Generate Product Descriptions

Suppose you have a dataset containing product names and features, and you want to generate a short description for each product. You can use the Generate Text transformation to create natural language descriptions based on the product features.

The video below demonstrates how to use the Generate Text transformation in just a few seconds. If you prefer text, please continue reading.

IDProduct NameFeatures
1SmartPhone X5G, 128GB storage, 6.5-inch display
2Tablet Pro10.2-inch display, Wi-Fi, 64GB storage

To do this, you would configure the transformation as follows:

Source Column: features
Destination Column: description
LLM Model: gpt-3.5-turbo
Credential ID: OpenAI
String Template: "Write a short description for a product with the following features: {features}"

Transformation - Generate Text

Transformation - Generate Text

The resulting dataset would look like this:

IDProduct NameFeaturesDescription
1SmartPhone X5G, 128GB storage, 6.5-inch displayThe SmartPhone X is a 5G-enabled device with a large 6.5-inch display and 128GB storage capacity, perfect for all your multimedia needs.
2Tablet Pro10.2-inch display, Wi-Fi, 64GB storageThe Tablet Pro offers a stunning 10.2-inch display, Wi-Fi connectivity, and 64GB storage, making it the perfect device for browsing, streaming, and more.

Example 2: Generate Frequently Asked Questions (FAQs) Responses

Suppose you have a dataset containing frequently asked questions about your products or services, and you want to generate responses for each question. You can use the Generate Text transformation to create natural language responses based on the given questions.

IDFAQ Question
1What are the warranty options for SmartPhone X?
2Can I connect my Tablet Pro to a wireless printer?

To do this, you would configure the transformation as follows:

Source Column: faq_question
Destination Column: faq_answer
LLM Model: gpt-3.5-turbo
Credential ID: OpenAI
String Template: "Provide a helpful response to this customer's question: {faq_question}"

The resulting dataset would look like this:

IDFAQ QuestionDescription
1What are the warranty options for SmartPhone X?Thank you for your question. The warranty options for SmartPhone X may vary depending on the retailer or carrier that you purchase it from. It is best to check with the specific retailer or carrier for information on their warranty options. However, many smartphones typically come with a manufacturer's warranty that covers defects and malfunctions for a certain period of time. Additionally, some retailers or carriers may offer extended warranty options for an additional fee.
2Can I connect my Tablet Pro to a wireless printer?Yes, you can connect your Tablet Pro to a wireless printer. You can do this by going to the settings on your tablet and selecting "Printing". From there, you can add your wireless printer and start printing. Make sure that your tablet and printer are connected to the same wireless network. If you need further assistance, you can refer to the user manual for your specific tablet or printer.