> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Part Number Detection use case

> Lucidworks AI Prediction API

export const LwTemplate = ({title = "Key questions to get you started", icon = "sparkles", cta = "Powered by Agent Studio", linkHref = "https://lucidworks.com/demo/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta_ai"}) => {
  const [isLoaded, setIsLoaded] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      setIsLoaded(true);
    }, 500);
    return () => clearTimeout(timer);
  }, []);
  return <div className="lw-template-container">
      <Card title={title} icon={icon}>
        {isLoaded && <span dangerouslySetInnerHTML={{
    __html: `<lw-template id="a029c1a9-28be-427e-b0e1-5d918920246a"></lw-template
            >`
  }} />}
        <Link href={linkHref} className="agent-studio-link text-left text-gray-600 gap-2 dark:text-gray-400 text-sm font-medium flex flex-row items-center hover:text-primary dark:hover:text-primary-light group-hover:text-primary group-hover:dark:text-primary-light">Powered by Lucidworks Agent Studio</Link>
      </Card>
    </div>;
};

<LwTemplate />

The Part Number Detection use case of the [LWAI Prediction API](/docs/lw-platform/lw-ai/lw-ai-apis/lw-ai-prediction-api/overview) detects part numbers in order to help with query routing and classification, and uses the embedding model to ingest text and return a JSON response of `true` if the input is a part number, or `false` if the input is not a part number.

<Note>
  IMPORTANT: This use case is only supported with a custom-trained embedding model trained with the Part Number Classification use case.
</Note>

## Prerequisites

To use this API, you need:

* The unique `APPLICATION_ID` for your Lucidworks AI application, which is provided by Lucidworks.
* A bearer token generated with a scope value of `machinelearning.predict`. For more information, see [Authentication API](/docs/lw-platform/lw-platform/authentication-api).
* A custom-trained Part Number Classification model.
* The `CUSTOM_DEPLOYMENT_ID` field from the custom-trained model for the use case request. The path is: `/ai/prediction/part-number-detection/CUSTOM_DEPLOYMENT_ID`.

## Unique values for the Part Number Detection use case

Some parameter values available in the `part number detection` use case are unique to this use case, including values for the `modelConfig` parameter.
Refer to the [API spec](/api-reference/get-predictions/part-number-detection-use-case) for more information.

## Part Number Detection use case example

<CodeGroup>
  ```json wrap Request theme={"dark"}
  curl --request POST \ 
    --url 'https://APPLICATION_ID.applications.lucidworks.com/ai/prediction/part-number-detection/CUSTOM_DEPLOYMENT_ID' \
    --header 'Cache-Control: no-cache' \
    --header 'Content-Type: application/json' \
    --header 'Authorization: Bearer ACCESS_TOKEN' \
    --data '{
      "batch": [
          {
              "text": "54956gf-98796v"
          },
          {
              "text": "bright pink sprinkles"
          }
      ]
  }'
  ```

  ```json wrap Response theme={"dark"}
  {
      "predictions": [
          {
              "tokensUsed": {
                  "inputTokens": 6,
                  "labelsTokens": 2
              },
              "labels": {
                  "true": 0.6388378143310547
              },
              "response": "true: 0.64"
          },
          {
              "tokensUsed": {
                  "inputTokens": 4,
                  "labelsTokens": 2
              },
              "labels": {
                  "false": 0.6262129545211792
              },
              "response": "false: 0.63"
          }
      ]
  }
  ```
</CodeGroup>
