Quick Start

In this guide we'll write a function to determine whether a comment is spam. By showing Nyckel examples of good comments and spam comments, we can train our function to tell the difference.

Create Your Function

  1. Sign up / sign in

    If you haven't already, sign up or log in to Nyckel by clicking 'Get Started' in the upper right corner.

  2. Create a new function

    If this is your first time on Nyckel, you're automatically directed to the New Function page. If you're signed into an account that already has functions, click the 'New Function' button.

  3. Select 'Text' as the input type

    This indicates that you'll provide textual data train your function.

  4. Create two labels

    Tell Nyckel which categories are allowed; create two labels named 'spam' and 'not spam' - we'll use these exact names later to speed data import.

  5. Click 'Next'

Train Your Function

  1. Download the example data

    Click here to download comment data you can use to train your function.

  2. Click the box to open upload dialog

    Click anywhere inside the dashed blue box to open the file dialog.

  3. Choose the file you downloaded

    Select the file you downloaded in step 1.

  4. Tell Nyckel the first row is a header

    Set 'First row contains column names' to 'True'.

  5. Select the 2nd column as the input column

    Click the column titled 'Comment' to indicate it contains the input data.

  6. Select the 3rd column as the output column

    Click the column titled 'Is Spam' to indicate it contains the output data.

  7. Click 'Import' and wait for training to complete

    Wait ~20 seconds as Nyckel imports the CSV and trains your function. You can watch the status bars update as the data is imported and the accuracy bars adjust as your functions initial accuracy is calculated. Note that a few of the sample inputs don't have outputs... Nyckel will give you the opportunity to annotate those manually in the UI.

Use Your Function

  1. Click the 'Invoke' tab

    Now we'll experiment with entering different inputs into our trained function to see how it does. Click on 'Invoke' in the left nav to get started.

  2. Try entering a good comment

    Enter something you would expect the function to say is not spam, such as Wow this is a great post!, then click 'Invoke'. Check the 'Function Output' to verify it correctly predicts that the comment is not spam.

  3. Try entering a spam comment

    Enter something you would expect the function to say IS spam, such as Thanks to @super_mom_31 I learned how to make $15,000 per month doing nothing!, and click 'Invoke'. Check the 'Function Output' to verify it correctly predicts that the comment is spam.

  4. Test calling your function via the API

    Now, copy the curl request provided and paste it into a command prompt.

    Check out the full API Reference to learn about how to integrate Nyckel functions into your application.

Now Try It With Your Data

Congrats! You just built a function that can tell the difference between real and spam comments... for this data at least. Upload your own data to build a custom function that serves your needs!