GuidesRecipesAPI ReferenceChangelogDiscussions
Log In

No-code Model Inference

Learn to use Modzy to run an ML model with this introductory tutorial

In this tutorial you will learn how to search for a model, take it for a test drive, run your first inference using Modzy's API, and view the results. All of this should take less than half-an-hour, so grab a fresh cup of coffee and follow-along :coffee:

:department-store: Find a model

Once you log into Modzy, click on the Models tab in the menu at the top of the page. This will take you to the Model Library.

Begin typing “Sentiment Analysis” into the search box and then click on the top result (it should show the number "ed542963de" beneath the title).


Searching for a sentiment analysis model in Modzy's model library

:car: Take your model for a test drive

After clicking on "Sentiment Analysis" in the previous step, you'll find yourself on the Overview page for this model. To try using this model yourself, click on the Test Drive tab on the left side of the screen.

In the 'Input' section, you can type in any English text that you'd like, such as the first line from your favorite novel or a funny tweet.

Once you've added some text, click the 'Start Job' button.

After a few seconds, this Sentiment Analysis model's results should appear on the right side of the screen under the 'Output' section. You should see a JSON object with a bunch of different numbers. These numbers describe the sentiment of the text you sent as being positive, neutral, or negative (usually a combination of all three).


Sending text to a sentiment analysis model using Modzy's "Test Drive" feature


For a quick interpretation of your result, compare the "class": "positive" and "class": "negative" scores. If the positive score is larger, the text is seen as more positive, if the negative score is larger, then the text is seen as more negative.

:crystal-ball: View model results

Once you’ve completed your first Sentiment Analysis inference using the Test Drive feature, you can look at the raw results on the Jobs page. Modzy uses to word Job to describe when one or more data inputs are passed through a model. Click on the Operations tab in the menu at the top of the page and then click on Jobs in the menu that appears right beneath it.


View of all previous model predictions, also known as "Jobs"

You can find the job you just submitted at the top of the jobs list. Click on the Job ID of the inference you just submitted to see more information. The Job Details page provides access that job’s predictions, inference times, and other metadata.


Viewing the results for a single submission to a sentiment analysis model

:key: Download your API key

Next, we'll use Modzy's API to send data to the same sentiment analysis model. Before you can start using it you will need an API Key. You can find and manage all of your API keys in your profile. Click on your name in the menu at the top left of the screen and then click API Keys.


Link to API Keys

You should see an API key listed for each of the teams to which you belong. If you belong to multiple teams, then you’ll see multiple keys. Find the API key for the applicable team and click on “Get Key” to download your API key.


List of API Keys

Next, open the text file downloaded from Modzy to view the full-length key. Modzy’s API keys have a 2-part format, a public portion (the characters to the left of the period) and a private portion (the characters to the right of the period). To work with Modzy’s APIs, you need the full string (including the period in the middle) for authentication. Store this file somewhere safe as you can only download it once.


An example of a Modzy API Key

:computer: Run a prediction from your terminal

Now that you have an API Key, you can directly interact with Modzy’s API. An easy way to do so is to copy the cURL example below, which will send your input to the Sentiment Analysis model we tested out earlier. You will just need to make the following substitution:

  • Replace ***<MODZY_URL> in the sample code below with the URL of your instance of Modzy
  • Replace API_KEY in the sample code below with the API key string you just downloaded

An easy way to do this is to paste the example below into a text editor, make your replacements, then copy the whole thing again before pasting it into your terminal or command prompt.

curl <MODZY_URL>/api/jobs -X POST \
 -H 'Content-Type: application/json' \
 -H 'Authorization: ApiKey API_KEY' \
 -d '{
      "model": {
        "identifier": "ed542963de",
        "version": "1.0.1"
      "input": {
        "type": "text",
        "sources": {
          "first-phone-call": {
            "input.txt": "Mr Watson, come here. I want to see you."
curl <MODZY_URL>/api/jobs -X POST ^
 -H "Content-Type: application/json" ^
 -H "Authorization: ApiKey API_KEY" ^
 -d "{\"model\":{\"identifier\": \"ed542963de\",\"version\":\"1.0.1\"},\"input\":{\"type\":\"text\",\"sources\":{\"first-phone-call\":{\"input.txt\":\"Mr Watson, come here. I want to see you.\"}}}}"

Once you’ve made those substitutions, open a terminal (MacOS, Linux) or command prompt (Windows), paste in this cURL command, and hit enter. When Modzy receives your request, you will receive a confirmation message with details about your job submission that includes a jobIdentifier number, the accessKey (the public portion of your API Key) used for the request, and much more. Modzy runs inferences asynchronously, so you can either request your results via an API request (with the /api/results/ endpoint), or you can view them again on the Jobs page.

      "name":"Sentiment Analysis"
      "externalIdentifier":"[email protected]",
      "email":"[email protected]",

:loop: Get results via API

Lastly, you can retrieve model results from Modzy's API too. Everything in Modzy accessible via API! An easy way to do so is to copy the cURL example below after you make the following substitutions:

  • Replace ***<MODZY_URL> in the sample code below with the URL of your instance of Modzy
  • Replace {jobIdentifier} with the jobIdentifier you received in the previous step
  • Replace API_KEY in the sample code below with the API key string you just downloaded
curl <MODZY_URL>/api/results/{jobIdentifier} -X GET \
 -H 'Content-Type: application/json' \
 -H 'Authorization: ApiKey API_KEY'
curl <MODZY_URL>/api/results/{jobIdentifier} -X GET ^
 -H "Content-Type: application/json" ^
 -H "Authorization: ApiKey API_KEY"

After running this script in your terminal, Modzy will return your results in a JSON object that should look similar to the following example.


You've now successfully built a script that can analyze the sentiment of any text!

If you're a developer you might want to take this model and use it to build your own custom web app. Here's another tutorial that does just that: Sentiment Analysis App Tutorial

If you're a data scientist, you might be interested in learning how Deploying Models works or how to use model drift Model Drift.

We can't wait to see what you build with Modzy! :wrench:

What’s Next

Once you've gotten a feel for Modzy, try building your first AI-powered app in Python, or packaging and deploying your first model