insertOne
method triggers MindsDB to generate an AI collection called sentiment_classifier
that uses the OpenAI integration to predict a field named sentiment
. The model is created inside the default mindsdb
project. In MindsDB, projects are a natural way to keep artifacts, such as models or views, separate according to what predictive task they solve. You can learn more about MindsDB projects here.
The training_options
key specifies the parameters that this handler requires.
engine
parameter defines that we use the openai
engine.prompt_template
parameter conveys the structure of a message that is to be completed with additional text generated by the model.insertOne
method has started execution, we can check the status of the creation process with the following query:
amazon_reviews
collection is used to make batch predictions. Upon joining the sentiment_classifier
model with the amazon_reviews
collection, the model uses all values from the review
field.