news_v3_classifications / query_structure_description.md
dustyatx's picture
Create query_structure_description.md
39e21ad verified
### Documentation: Querying with `**` Anchor Tags
#### Overview
This model processes the following data types: `organizations`, `products_and_services`, `topics`, and `classifications`. When querying the model, the developer must pass the query types in a specific format using double asterisks (`**`) to denote emphasis. This format ensures that the model correctly identifies and retrieves the requested data based on the type.
#### Query Structure for Types
The structure for querying the model involves passing the type of data in the following format:
1. **For All Types (Organizations, Products and Services, Topics, Classifications)**:
- The type must be **uppercased**.
- Any underscores (`_`) in the type name should be replaced with spaces.
- The entire type must be wrapped in double asterisks (`**`).
- After the formatted type, a newline (`\n`) is inserted, followed by the value from the `anchor` field.
- Example query strings:
- `**PRODUCTS AND SERVICES**\n{anchor_value}`
- `**ORGANIZATIONS**\n{anchor_value}`
- `**TOPICS**\n{anchor_value}`
- `**CLASSIFICATIONS**\n{anchor_value}`
#### Query Structure Examples for All Types
Here’s the complete list of types and how to structure the query for each:
1. **Products and Services**:
- Query format: `**PRODUCTS AND SERVICES**\n{anchor_value}`
- Example: `**PRODUCTS AND SERVICES**\nProduct Anchor Text`
2. **Organizations**:
- Query format: `**ORGANIZATIONS**\n{anchor_value}`
- Example: `**ORGANIZATIONS**\nOrganization Anchor Text`
3. **Topics**:
- Query format: `**TOPICS**\n{anchor_value}`
- Example: `**TOPICS**\nTopic Anchor Text`
4. **Classifications**:
- Query format: `**CLASSIFICATIONS**\n{anchor_value}`
- Example: `**CLASSIFICATIONS**\nClassification Anchor Text`
#### Guidelines for Constructing Queries
1. **Uppercasing**: Always use uppercase for the type being queried, regardless of the original case in the data.
2. **Replacing Underscores**: For types with underscores (`_`), replace them with spaces to ensure proper formatting.
3. **Double Asterisks (`**`)**: The type must always be wrapped in double asterisks to emphasize it in the query.
4. **Newline for All Types**: Append the `anchor` value after a newline character for all types.
This ensures consistency and clarity when querying the model for specific data types, allowing accurate data retrieval while maintaining clear formatting.