Getting Started with AI21Labs for Non-Techies: Supercharge your Writing and Reading Works and Build Your NLP-Powered Services

Wednesday, June 28, 2023 by septian_adi_nugraha408
Getting Started with AI21Labs for Non-Techies: Supercharge your Writing and Reading Works and Build Your NLP-Powered Services

Introduction

Introducing AI21Labs

AI21 Labs is an innovative company that focuses on developing artificial intelligence (AI) tools to improve how we read, write and interact with text. They specialize in Natural Language Processing (NLP), a field of AI that deals with understanding and generating human language.

Their flagship product, Wordtune, is a writing companion tool designed to help users rephrase their writing to convey their thoughts more accurately. They also offer Wordtune Read, an AI-powered reading service that can summarize lengthy documents for quicker understanding.

In addition to these tools, AI21 Labs provides scalable and efficient AI-powered software solutions for those who want to build custom applications. Their AI21 Studio offers large language model APIs that can be easily customized to suit your specific needs β€” without requiring any NLP expertise. And if you work with sensitive data, rest assured as AI21 Labs is security compliant.

The technology behind AI21 Labs relies on advanced pattern recognition offered by cutting-edge deep language models. As they continue to develop enriched models that understand context and semantics at unprecedented levels, their services can seamlessly scale up with your growing customer base. Additionally, AI21 Labs provides resources such as demos, expert talks, and detailed information about advancements in NLP and machine learning for further learning.

Introduction to NLP

NLP, or Natural Language Processing, is a branch of artificial intelligence that focuses on the interaction between computers and humans through language. It involves programming computers to process and analyze large amounts of natural language data, which is the language that has been naturally developed by humans for communication. In the context of AI21 Labs, NLP is used to create tools that can understand and generate human language, transforming machines into thought partners for humans. This includes a writing companion tool that helps users rephrase their writing and an AI reader that can summarize lengthy documents.

Prerequisites

  • Basic knowledge of prompt engineering
  • Access to AI21Labs Products
  • A web browser

Outline

  1. Browsing Through AI21Labs Offerings
  2. Finding Better Choice of Words with Wordtune
  3. Aid Your Research by Summarizing with Wordtune Read
  4. Trying Out the Studio

Discussion

Browsing Through AI21Labs Offerings

First things first, let's start by browsing through the AI21 Labs' website.

The home screen of AI21 Labs' website, showing menu items of AI21 Studio, Wordtune, and Wordtune Read

Such an impressive website, with a punchy, memorable opening line to boot: "When Machines Become Thought Partners". Personally, I hope that this line was created by an actual human mind, not AI. Anyway, let's start scrolling down.

Next up, we're met with the introduction to Wordtune. As a writer, one of the primary pain points of writing is finding exactly the words we want to use. Limitations such as vocabulary and reading comprehension sometimes stall me in my writing endeavor. With Wordtune, AI21 Labs promises a writing companion tool that helps us rephrase our writing to say exactly what we mean.

Wordtune, a writing companion service by AI21 Labs

As we can see from the preview, we can even shorten, lengthen, rewrite our lines completely, and set the tone. With that, we won't have to rack our brains anymore each time we need to blog on LinkedIn to drive our engagements! Aren't we thrilled for that opportunity yet?

Wordtune Read, an "AI reading" service to summarize long text

Next, we've also got Wordtune Read here. Let's be honest, sometimes during our research phase of writing – be it for reports, reviews, or other valuable content – we take more time than we're comfortable with. Meanwhile, deadlines loom overhead. Fortunately, with Wordtune Read, we can condense long text and even capture the main idea from the points of view that matter the most!

Finally, when we're getting an idea of what kind of services we can build that leverage NLP, there's always AI21 Studio.

Title for AI21 Studio on the home screen

With the Studio, we can test out our ideas easily, generate testable prototypes, and create ready-to-use code that developers can implement immediately in our products.

Finding Better Choice of Words with Wordtune

Let's proceed to the first of AI21 Labs' offerings: Wordtune. After we enter the Wordtune page, click the button that says "Get Wordtune, it's free".

The page of Wordtune

Next, Wordtune will ask us to sign up. Let's sign up with our favorite authentication provider! After that, we should encounter this welcome screen.

Welcome screen for Wordtune

The onboarding shouldn't take long. How exciting! Afterward, we're faced with two options: "Read and Summarize" or "Write and Paraphrase". Let's click the "Write better" button for now, as we'll demonstrate how AI21 Labs' writing AI assistant works.

Product gateway page; the user can choose whether to read faster or write better

Voila! We should see the page where we can type in our text. Above the text input field, there are several buttons, which, as we can guess, should work as they're labeled:

  • "Rewrite" button to rewrite our text
  • "Casual" button to set the tone of our text to casual
  • "Formal" button to set the tone of our text to formal
  • "Shorten" to make our text shorter
  • "Expand" to elaborate more on our text
  • "Spices" to enhance our writing further by continuing, explaining, emphasizing, giving examples, counterarguments, definitions, analogies, statistical facts, and even making jokes!

Let's start our text with a simple line stating a somewhat obvious opinion: "I think piracy is wrong, especially if one profits from it.".

Our editor page with our first line

So, what do we want to do? Let's first try setting it to a more formal tone! Click the "Formal" button.

The more formal tone of our line

The Wordtune editor provided us with so many options to choose from! Oh, the woe of making choices! Anyway, we need to make a choice to move on. Let's say I chose: "The act of piracy should be condemned, especially if it is profit-oriented."

The line we chose to formalize the tone

So far, so good. However, in real life, we might encounter people who like to disagree, no matter how "right" our opinions are. So, how about we add more statistical data to support our argument? Click the "Spices" button and select "Statistical fact".

Opinion against piracy and the statistical data supporting it by Zurich, which estimates the costs incurred by piracy that reaches $12 billion annually.

Impressive! Wordtune added statistical data from iii.org that states: "Zurich estimates that piracy costs the global economy $12 billion annually, and the IMB PRC reports that piracy and armed robbery numbers increased by 20% last year." It is somewhat interesting that piracy and armed robbery are mentioned in the same sentence! Maybe piracy is as heinous as robbery, after all!

Aid Your Research by Summarizing with Wordtune Read

There are many other features that we can explore, but let's move on to the next feature: Wordtune Read. Interestingly, while Wordtune Read was introduced as a separate product, it's actually integrated within the editor we used earlier. Click the button that says "Upload to summarize".

The user interface of Wordtune Read

We should see the user interface for Wordtune Read. We have three options: upload PDF, paste link, or paste text. For this tutorial, let's demonstrate how good Wordtune Read is at processing PDF documents and summarizing the content. Download this text on "Intellectual Property".

After uploading the PDF file, Wordtune should take a moment to process our document.

The result of our processed document

Interestingly, Wordtune Read shows us the "Summary" of the text, as well as the original document, with some parts highlighted. It indicates which parts of the text were used to create the summary.

We can hover over the summary items and perform some actions on them

Moreover, we can also hover over the summary items and perform some actions on them. We can view the source of the summary (the highlighted part), copy the summary item, take the item as notes, and, if we find the summary unsatisfying, we can always choose to "Re-summarize".

This makes Wordtune Read an excellent companion service to aid us in our research, which in turn helps increase our productivity when writing by allowing us to copy the summary results into our notes for further processing.

Trying Out the Studio

Let's get a bit more technical this time! Don't worry though, as we will explore some examples offered by the service. Head to the AI21 Studio user interface.

The user interface of AI21 Studio

If you find yourself saying "Task-specific APIs? Fine-tuning sets? Foundation models? Oh my!", don't fret. In this tutorial, we'll explore the available examples. Click the "Examples" menu to show the use-case examples.

The examples provided by AI21 Studio

Continuing with the "anti-piracy" theme from earlier, let's select the "Predict the outcome" example. If you can't find it, simply search for it using the search bar.

The Predict the outcome example

This is where things get interesting. Let's say we want the AI to predict the outcome if we were to pirate a book, use it to write content, and then monetize that content. To do this, replace the last action ("I put the ice cream outside for an hour") with "I made content based on a Harry Potter book, which I pirated from the internet. I got a hundred bucks from the content."

The prediction by the AI, suggesting that we will get in trouble for pirating books and making money from them

Voila! The AI predicted that we would get in trouble for pirating the book and making money from it! This should serve as a warning to respect the works of others and pay more attention to intellectual property concerns. As a bonus, we can generate code that our developers can use to develop our product if we find the prototype satisfactory. Click the "Code" button to see the image below.

The generated code from our earlier prompt prototype

Our developers can then use this code for their Python or JavaScript apps. Even if they use other programming languages, making HTTP requests to the API is simple enough, as the cURL command is also formatted neatly and ready to use.

Conclusion

Throughout this tutorial, we explored the language understanding products by AI21 Labs, which are conveniently packaged into Wordtune, Wordtune Read, and AI21 Studio. These AI writer/reader tools prove to be great aids not only for technical professionals such as programmers, but also for copywriters, marketers, legal experts, researchers, and other roles involving heavy reading, researching, and writing tasks.

We've learned that by using Wordtune, we can start writing with simple ideas or premises and expand them by prompting the AI to continue our writing, supporting our writing with quotes, statistical data, analogies, and even humor. We can also change the tone of our writing on the fly by clicking on either "Formal" or "Casual".

For research purposes, we can use Wordtune Read to process text from various sources, such as PDFs, web pages, and copied texts. Further refinements are possible to improve our summaries, allowing us to easily copy information or take notes.

Lastly, AI21 Studio enables us to test and prototype different use cases and prompts, which we can refine later. When we're ready to take our ideas into production, generating the code for sending prompts to the AI is as simple as clicking a button.

Thank you for joining me in this tutorial. I hope you've had as much fun exploring the many neat features of AI21 Labs as I did while testing and writing this tutorial. I look forward to seeing you in the next one!

Discover tutorials with similar technologies

Upcoming AI Hackathons and Events