Skip to content

Collections

Classifiers purpose-built for specialist tasks.

classify_uniclass

classify_uniclass(text, filter='', title='N/A', model=None, vector_client=None, openai_client=None)

Classifies the input text to a matching Uniclass code. Implements the Hoppa HARDR algorithm - a multi-step approach leveraging vector similarity search and LLM steps - with Azure OpenAI.

More information on Uniclass can be found at: https://uniclass.thenbs.com/

Parameters:

Name Type Description Default
text str | dict | list | int

input text to be classified.

required
title str

a brief title for the input text.

'N/A'
filter str

an ODATA query to filter to Uniclass table (subsystem). See examples below.

''
model str | None

Model deployment name within your Azure resource. If not provided will default to environment variable AZURE_OPENAI_DEPLOYMENT.

None
vector_client AzureVectorStorageClient | None

Optional AzureVectorStorageClient instance to reuse. If not provided, a new client will be created. Providing a shared client instance improves performance in concurrent scenarios.

None
openai_client AzureOpenAIClient | None

Optional AzureOpenAIClient instance to reuse. If not provided, a new client will be created. Providing a shared client instance improves performance in concurrent scenarios.

None

Returns:

Type Description
dict[str, Any]

JSON-formatted dictionary containing:

  1. code: selected classification code.
  2. title: title / description of the classification code
  3. certainty: confidence score, either "low", "medium" or "high".
  4. explanation: concise explanation of why this code was chosen.

Examples:

Classify to the Products table only.

>>> classify_uniclass(text="In-situ reinforced concrete upstand beam", filter="subsystem eq Products")

Classify using a shared client for better performance:

>>> client = AzureVectorStorageClient()
>>> classify_uniclass(text="In-situ reinforced concrete upstand beam", vector_client=client)

classify_nrm

classify_nrm(text, filter='level lt 4', model=None, vector_client=None, openai_client=None)

Classifies the input text to a matching NRM (RICS New Rules of Measurement) code. Implements the Hoppa HARDR algorithm - a multi-step approach leveraging vector similarity search and LLM steps - with Azure OpenAI.

More information on NRM can be found at: https://www.rics.org/profession-standards/rics-standards-and-guidance/sector-standards/construction-standards/nrm

Parameters:

Name Type Description Default
text str | dict | list | int

Input text to be classified.

required
filter str

an ODATA query to filter to NRM hierarchical level. See examples below.

'level lt 4'
model str | None

Model deployment name within your Azure resource. If not provided will default to environment variable AZURE_OPENAI_DEPLOYMENT.

None
vector_client AzureVectorStorageClient | None

Optional AzureVectorStorageClient instance to reuse. If not provided, a new client will be created. Providing a shared client instance improves performance in concurrent scenarios.

None
openai_client AzureOpenAIClient | None

Optional AzureOpenAIClient instance to reuse. If not provided, a new client will be created. Providing a shared client instance improves performance in concurrent scenarios.

None

Returns:

Type Description
dict[str, Any]

JSON-formatted dictionary containing:

  1. code: selected classification code.
  2. title: title / description of the classification code
  3. certainty: confidence score, either "low", "medium" or "high".
  4. explanation: concise explanation of why this code was chosen.

Examples:

Classify to the top-level (level 1) NRM code only.

>>> classify_nrm(text="In-situ reinforced concrete upstand beam", filter="level lt 2")

Classify using a shared client for better performance:

>>> client = AzureVectorStorageClient(index_name="quantity-surveying")
>>> classify_nrm(text="In-situ reinforced concrete upstand beam", vector_client=client)

classify_pomi

classify_pomi(text, filter='level gt 1', model=None, vector_client=None, openai_client=None)

Classifies the input text to a matching POMI (Principles of Measurement (International) For Works of Construction) code. Implements the Hoppa HARDR algorithm - a multi-step approach leveraging vector similarity search and LLM steps - with Azure OpenAI.

Parameters:

Name Type Description Default
text str | dict | list | int

input text to be classified.

required
filter str

an ODATA query to filter to NRM hierarchical level. See examples below.

'level gt 1'
model str | None

Model deployment name within your Azure resource. If not provided will default to environment variable AZURE_OPENAI_DEPLOYMENT.

None
vector_client AzureVectorStorageClient | None

Optional AzureVectorStorageClient instance to reuse. If not provided, a new client will be created. Providing a shared client instance improves performance in concurrent scenarios.

None
openai_client AzureOpenAIClient | None

Optional AzureOpenAIClient instance to reuse. If not provided, a new client will be created. Providing a shared client instance improves performance in concurrent scenarios.

None

Returns:

Type Description
dict[str, Any]

JSON-formatted dictionary containing:

  1. code: selected classification code.
  2. title: title / description of the classification code
  3. certainty: confidence score, either "low", "medium" or "high".
  4. explanation: concise explanation of why this code was chosen.

Examples:

Classify to the top-level (level 1) NRM code only.

>>> classify_pomi(text="In-situ reinforced concrete upstand beam", filter="level gt 1")

Classify using a shared client for better performance:

>>> client = AzureVectorStorageClient(index_name="quantity-surveying")
>>> classify_pomi(text="In-situ reinforced concrete upstand beam", vector_client=client)

beta_classify_etim

beta_classify_etim()

Classifies the input text to a matching ETIM code.

More information on Omniclass can be found at: https://www.etim-international.com/.

beta_classify_omniclass

beta_classify_omniclass()

Classifies the input text to a matching Omniclass code.

More information on Omniclass can be found at: https://www.csiresources.org/standards/omniclass.