Generating content right inside your python project just takes 3 lines of code. To make things as easy as possible we have published a python package that you can install with the following command:

pip install textcortex

After installing the package, generating content gets very easy and pretty fast. There are different types of content that can be generated with TextCortex. These are:

  • Blog Articles
  • Product Descriptions
  • Instagram Captions
  • Ads
  • Email body
  • Email subject
  • Autocompletion of instructed prompts

Here is an example using the TextCortex python package to generate blog articles:

from textcortex import TextCortex

# Create the hemingwai object and enter your API Key
hemingwai = TextCortex(api_key='YOUR_API_KEY')

# Generate Blog articles using Hemingwai
blog = hemingwai.generate_blog(blog_title='Why SEO is important for your Business?', 
	blog_categories=['SEO', 'Business'],
	source_language='en', character_count=400, creativity=0.7, n_gen=2)
print(blog)

Text generation variables:

As you can see, there are some parameters that you can use to fine-tune the generated content. Here is the list of those parameters and what they do:

  • prompt: Prompting is a way to instruct the Enterprise API to start writing on a specific subject
  • parameters: Used for setting the tone of the generated copy text. It can be basically anything but please keep it plausible :)
  • blog_categories: This defines which type of content needs to be generated.
  • creativity: Floating number between 0-1. 0 being the lowest creativity and 1 being the highest. Default is 0.7
  • character_length: Integer which defines the maximum amount of characters that can be produced.
  • source_language: Language code of the source language of the written prompt. for example 'en' for English and 'de' for German. We support 72 languages. If you don't know the language code you can also use 'auto' for this field our system will recognize the language of the instructed prompt and follow through with it in its generation.

More usage examples can be found on the TextCortex text generation examples Github repo.