# Classifications API > Given a query and a set of labeled examples, the model will predict the most likely label for the query. Useful as a drop-in replacement for any ML classification or text-to-label task. > > https://beta.openai.com/docs/api-reference/classifications Classifications is where things get quite interesting. You give it a set of labelled texts, and it can label those texts for you. So lets start with some data, and see 2 ways we could work with that data. ```php use SiteOrigin\OpenAI\Client; use SiteOrigin\OpenAI\Engines; $examples = [ ["A happy moment", "Positive"], ["I am sad.", "Negative"], ["I am feeling awesome", "Positive"], ]; $client = new Client($_ENV['OPENAI_API_KEY']); $result = $client->classifications(Engines::CURIE)->create('It is a raining day :(', $examples); echo 'This sentence is ' . $result->label; ``` Where the output of `$result` is: ```php (object) array( 'completion' => 'cmpl-3J0IkUnjHCqNfBKyindWidBmFvuOI', 'label' => 'Negative', 'model' => 'curie:2020-05-03', 'object' => 'classification', 'search_model' => 'ada', 'selected_examples' => array ( 0 => (object) array( 'document' => 1, 'label' => 'Negative', 'text' => 'I am sad.', ), 1 => (object) array( 'document' => 0, 'label' => 'Positive', 'text' => 'A happy moment', ), 2 => (object) array( 'document' => 2, 'label' => 'Positive', 'text' => 'I am feeling awesome', ), ), ); ``` Of course, you can also upload a file and use that. In production, you'd obviously only upload the file once, then reference it for all future classifications. ```php use SiteOrigin\OpenAI\Client; use SiteOrigin\OpenAI\Engines;use SiteOrigin\OpenAI\Files; $examples = [ ["text" => "A happy moment", "label" => "Positive"], ["text" => "I am sad.", "label" => "Negative"], ["text" => "I am feeling awesome", "label" => "Positive"], ]; $client = new Client($_ENV['OPENAI_API_KEY']); $file = $client->files()->create('data.json', $examples, Files::PURPOSE_CLASSIFICATIONS); // Wait for the file to process $result = $client->classifications(Engines::CURIE)->create('It is a raining day :(', $file->id); ```