Text Classification with Large Language Models (LLMs)

Hussain Poonawala
15 min readMay 26, 2024

--

Text classification using LLMs

Like many individuals today, I find myself integrating AI into various aspects of my daily routine. The versatility and capabilities of AI have made it an indispensable tool in numerous applications, from automating simple tasks to providing insightful analysis. Recently, I’ve been exploring the potential of Large Language Models (LLMs) and came across an intriguing idea: using LLMs for classification tasks.

Classification, for those unfamiliar, involves labeling or categorizing data into different groups. This labeled data set is used to train AI models. It’s a basic task in NLP and has numerous applications — one of which is training these Large Language Models.

Text classification can be challenging when dealing with unstructured data. Given a general understanding of the world, I thought it was possible to do so using LLMs. To verify my theory, I conducted a small proof of concept (POC) to determine its feasibility and to identify any potential issues.

As a relevance engineer in the e-commerce sector, I decided to classify products for a search term into three categories: Relevant, Less Relevant, and Not Relevant.

For example, if you search for “Apple iPhone 15,” you’ll see results like “iPhone 15,” “iPhone 15 Pro,” and “iPhone 13.” While “iPhone 15” is relevant to the search term, “iPhone 15 Pro” is less so due to a model mismatch. “iPhone 13,” however, is not relevant at all. Typically, this kind of classification requires manual effort.

Prerequisites:

Before diving into the Python script, let’s go through the prerequisites. Here are the steps I followed to ensure everything runs smoothly:

  1. Environment Setup: To manage dependencies and versions more efficiently, I used Conda. It simplifies the process and helps avoid conflicts.
  2. Cost-Effective Models: Working within a limited budget, I opted for cost-effective solutions like Ollama and local models such as Llama 3 and Mistral LLMs. These models provide robust performance without incurring high costs.
  3. Code Editor: I used Visual Studio Code to write the Python code. Its powerful features and extensions make it an excellent choice for coding and debugging.

Approach 1: Simple Prompt Engineering

Prompt Engineering Flow

Prompt engineering is the practice of designing and refining input prompts to effectively interact with large language models (LLMs). The goal is to extract the desired output from the model, whether it’s generating text, answering questions, classifying data, or performing other tasks.

I wrote a detailed single prompt and asked the model to classify the products for the search term provided.

"""
This function retrieves products based on a search query from e-commerce websites such as Amazon, eBay, or Flipkart.
It sends a request to the specified website, processes the response, and extracts relevant product information for further analysis.
"""
def getProductDetails(searchTerm: str) -> list:
url = 'https://example.com/search' # Use any website of your preference
params = {
'searchTerm': searchTerm,
'page': '1',
'start': '0',
'itemPerPage': '40'
# other params
}

headers = {} # Headers depending on the website you want to call

try:
response = requests.get(url, headers=headers, params=params, verify=False) # set verify=False to ignore SSL verification

if response.status_code == 200:
response_data = response.json()

# Check if API response is successful and products are not null
if response_data.get('products'):
# Extract products
products = response_data['products']

# Initialize an empty list to store formatted results
formatted_results = []

# Iterate over each product and extract required information
for product in products:
name = product.get('name', '')
sku = product.get('sku', '')


# Create a dictionary for the formatted result
formatted_result = {
"sku": product.get('sku', ''),
"name": product.get('name', ''),
"category": product.get('categories', ''),
"brand": product.get('brand', ''),
"description": product.get('description', '')
}
# Append the formatted result to the list
formatted_results.append(formatted_result)

return formatted_results
else:
print("API response is not successful or products are null.")

else:
print("Error:", response)

except Exception as e:
print(f"Error occurred: {e}")

return []
if __name__ == '__main__':
load_dotenv()
client = OpenAI(
base_url='http://localhost:11434/v1/',
# required but ignored
api_key='ollama',
)

searchTerm = input("Enter search term: ")

prompt = """
Classify if the products in the product list are relevant to the search term: {searchTerm}.
Think from a user perspective who is buying these products from an ecommerce online store.

You can classify each product into 3 categories:
1. Relevant
2. Not Relevant
3. Somewhat Relevant

For each product, provide a detailed audit reason for the choice made.
Audit Reasons can be chosen from the below list for the different classifications:
1. For 'Relevant' possible options for auditReasons: "Relevant"
2. For 'Not Relevant' possible options for auditReasons: "Incorrect Product" OR "Gender Mismatch"
3. For 'Somewhat Relevant' possible options for auditReasons: "Brand Mismatch" OR "Size Mismatch" OR "Color Mismatch" OR "Quantity/Count Mismatch" OR "Flavour Mismatch" OR "Variant Mismatch" OR "Other Attributes Mismatch" OR "Accessory Of The Main Product/Complimentary Product And Vice-Versa" OR "Model Number Mismatch - Completely Different" OR "Model Number Mismatch - Slight Variation" OR "Reason Not Listed"]

Make sure to only select the reasons from the category it is from. Do not mix and match reasons from different categories.

DOs:
1. Be specific and clear.
2. Understand the search term as well as the product data and then categorize it into 3 categories as mentioned above.
3. Act as a customer

DONTs
1. Do not guess or hallucinate
2. Do not create new auditReasons. Use the ones already provided above.


The output format should be as follows:
{
relevant: "",
auditReasons: [],
"reason": ""
}

relevant should be a string from the above categories ie Relevant, Not Relevant or Somewhat Relevant.
auditReasons should be a list of strings from the above reasons.
reason should be the reason why the category is selected.

Examples:
1. searchTerm: 'samsung s23 red'.
If product is samsung s23 red ->
Output: { relevant: "Relevant", auditReasons: [], "reason": "It belongs to relevant category as the search term and product are same"}

If product is samsung s23 blue ->
Output: { relevant: "Somewhat Relevant", auditReasons: ['Color Mismatch'], "reason": "It belongs to somewhat relevant category as the color of product is blue but the search term is looking for red"}

If product is samsung s24 red ->
Output: { relevant: "Somewhat Relevant", auditReasons: ['Model Number Mismatch - Completely Different'], "reason": "It belongs to somewhat relevant category as the model of product is s24 but the search term is looking for s23"}

If product is samsung s23 ->
Output: { relevant: "Somewhat Relevant", auditReasons: ['Reason Not Listed'], "reason": "It belongs to somewhat relevant category as color is not specified"}

If product is samsung galaxy note ->
Output: { relevant: "Not Relevant", auditReasons: ['Incorrect Product'], "reason": "It belongs to not relevant category as the product is a galaxy note but the search term is looking for s23"}


2. searchTerm: 'samsung'.
If product is samsung s23 red ->
Output: { relevant: "Relevant", auditReasons: [], "reason": It belongs to relevant category as the search term is generic and the brand is same"}

If product is samsung s23 blue ->
Output: { relevant: "Relevant", auditReasons: [], "reason": It belongs to relevant category as the search term is generic and the brand is same"}

If product is samsung tshirts ->
Output: { relevant: "Relevant", auditReasons: [], "reason": "As the search term is generic and user might be looking for tshirts "}

If product is samsung washing machine ->
Output: { relevant: "Relevant", auditReasons: [], "reason": "It belongs to relevant category as the search term is generic and the brand is same and category is electronics which is known for samsung products"}

If product is samsung watches ->
Output: { relevant: "Relevant", auditReasons: [], "reason": "It belongs to relevant category as the search term is generic and the brand is same and category is electronics which is known for samsung products"}


3. searchTerm: 'apple'.
If product is apple ->
Output: { relevant: "Relevant", auditReasons: [], "reason": "It belongs to relevant category as the search term is generic and the user might be looking for fruits"}

If product is iphone ->
Output: { relevant: "Relevant", auditReasons: [], "reason": "It belongs to relevant category as the search term is generic and apple is known for mobile phones"}

If product is iphone 15 ->
Output: { relevant: "Relevant", auditReasons: [], "reason": "It belongs to relevant category as the search term is generic and apple is known for mobile phones"}

If product is bananas ->
Output: { relevant: "Somewhat Relevant", auditReasons: ["Model Number Mismatch - Completely Different"], "reason": "It belongs to relevant category as the search term is generic and the category might be fruits"}

If product is samsung s23 ->
Output: { relevant: "Not Relevant", auditReasons: ["Incorrect Product"], "reason": "As the search term is generic it can be either fruit or electronics. But brand is different"}


4. searchTerm: 'oil 2ltr'
If product is 'oil' ->
Output: { relevant: "Somewhat Relevant", auditReasons: ["Quantity/Count Mismatch"], "reason": "It belongs to somewhat relevant category due to 'Quantity/Count Mismatch' as quantity is not specified"}

If product is 'oil 10ltr' ->
Output: { relevant: "Somewhat Relevant", auditReasons: ["Quantity/Count Mismatch"], "reason": "It belongs to somewhat relevant category due to 'Quantity/Count Mismatch' as quantity is different"}

If product is 'water 5ltr' ->
Output: { relevant: "Not Relevant", auditReasons: ["Incorrect Product"], "reason": "It belongs to not relevant category due to 'Incorrect Product' as the product is water but search term is oil"}

5. searchTerm: 'womens black shirt'
Product options:
If product is 'black shirt' ->
Output: { relevant: "Somewhat Relevant", auditReasons: ["Other Attributes Mismatch"], "reason": "It belongs to somewhat relevant category due to 'Other Attributes Mismatch' as gender is not specified"}

If product is 'mens black shirt' ->
Output: { relevant: "Not Relevant", auditReasons: ["Gender Mismatch"], "reason": "It belongs to not relevant category due to 'Gender Mismatch' as gender is different"}

If product is 'women red shirt' ->
Output: { relevant: "Somewhat Relevant", auditReasons: ["Color Mismatch"], "reason": "It belongs to somewhat relevant category due to 'Color Mismatch' as color is different"}

If product is 'women red t-shirt' ->
Output: { relevant: "Somewhat Relevant", auditReasons: ["Other Attributes Mismatch"], "reason": "It belongs to somewhat relevant category due to 'Other Attributes Mismatch' as searchTerm was shirt but the product is t-shirt"}


6. searchTerm: 'nike shoes'

If product is 'nike jordan shoes' ->
Output: { relevant: "Relevant", auditReasons: [], "reason": "It belongs to relevant category as the brand and category is same"}

If product is 'addidas shoes' ->
Output: { relevant: "Somewhat Relevant", auditReasons: ['Brand Mismatch'], "reason": "It belongs to somewhat relevant category due to 'Brand Mismatch' as brand is different"}

If product is 'nike joggers' ->
Output: { relevant: "Not Relevant", auditReasons: ['Incorrect Product'], "reason": "It belongs to not relevant category due to 'Incorrect Product' as product is jogger but we are looking for shoes"}


7. searchTerm: 'mobile phone'
Product options:
If product is 'mobile covers' ->
Output: { relevant: "Somewhat Relevant", auditReasons: ["Accessory Of The Main Product/Complimentary Product And Vice-Versa"], "reason": "It belongs to somewhat relevant category due to 'Accessory Of The Main Product/Complimentary Product And Vice-Versa' as product is mobile cover but we are looking for mobile phone"}

If product is 'samsung s23' ->
Output: { relevant: "Relevant", auditReasons: [], "reason": "It belongs to relevant category as the search term is generic and the product belongs to electronics/mobile phones category"}

If product is 'apple macbook' ->
Output: { relevant: "Not Relevant", auditReasons: ["Incorrect Product"], "reason": "It belongs to not relevant category due to 'Incorrect Product' as product is macbook but we are looking for mobile phones"}

Do not forget the dos and don'ts and reply in the above output format.
"""

# Get the products using the above function
products = getDataForVS(searchTerm)
finalData = []

for product in products:
print(product)
# call local llm to get the relevancy
chat_completion = client.chat.completions.create(
response_format={ "type": "json_object" },
messages=[
{"role": "system", "content": prompt},
{'role': 'user','content': f"Get the relevancy of the product: {product} with the search term: {searchTerm}",}
],
model='mistral:latest',
)
print(chat_completion.choices[0].message)
response = json.loads(chat_completion.choices[0].message.content)
finalData.append(
{
'sku': product['sku'],
'relevancyFromLlm': response['relevant'],
'reasonFromLlm_1': response['auditReasons']
}
)

print(finalData)

The results were not at all what I expected. The LLM was incorrectly classifying things a lot. For the same product, it would classify it into different categories when run multiple times, each time with a different reasoning.

Output:

Classification done by LLM for 3 different products for the “samsung s23” search term
Classification done by LLM for the “color pencil” search term

One hypothesis could have been the ‘n’ different possibilities and my prompt couldn’t have encompassed all the scenarios. One-shot prompting didn’t work well.

So I decided to reduce the scope. I decided to try classification only for a single category: “Handphones and Tablets” so that the prompt would be simpler, and the possibilities would be reduced. The results were better than the first approach but still not to the mark. I tried playing around with the prompt but it didn’t help much.

Approach 2: Help the LLMs by adding some rules and doing the classification step-by-step

After hours of struggling, I decided to try another approach. What if we help the LLM by introducing certain rules to the flow? We would try to classify the product step by step just as a human would do!

If I were the auditor, the first step would be to see if the search term and product belong to a similar category. After that, I would look for brand information in the search term and product. If both do not match, it usually means that the products are not relevant. However, if both match, I would further check for model, color, and specific attribute information. If all match, it’s relevant. If something doesn’t match, it’s less relevant.

def processLLM(product, searchTerm, resp):
# Flags for different things to check
isCategorySimilar = "No"
isBrandAvailable = "No"
isBrandSimilar = "No"
isAccessory = "No"
isModelAvailable = "No"
isModelSimilar = "No"
isColorAvailable = "No"
isColorSimilar = "No"

reasonList = []
MODEL = os.getenv('MODEL')
RESPONSE_FORMAT = { "type": "json_object" }
openAiClient = OpenAI(
base_url='http://localhost:11434/v1/',
# required but ignored
api_key='ollama',
)


# 1. Check if category matches
PROMPT = [
{"role": "system", "content": "You are an ecommerce auditor whose job is to compare the searchTerm and product, and classify the product into Relevant, Somewhat Relevant or Not Relevant. For that, you will be asked questions and you have to answer in Yes or No. And use the answers to do the classification."},
{'role': 'user','content': f"Are the categories of the '{searchTerm}' and {product['category']} similar or subset? If categories are similar/subset answer 'Yes' and if categories are different answer 'No' " + "Answer in the given format: {'answer': 'Yes/No', 'reason': 'Reason for the answer'} "},
]
chat_completion = openAiClient.chat.completions.create(
response_format=RESPONSE_FORMAT,
messages=PROMPT,
model=MODEL,
)

print(f"Comparison between {searchTerm} AND {product['category']}")
print(f"Answer 1 -> Category Check: {chat_completion.choices[0].message.content}")


isCategorySimilar = json.loads(chat_completion.choices[0].message.content)["answer"]
if(isCategorySimilar == "Yes"):
# Check if the brand data exists in the search term
PROMPT.append({"role": "assistant", "content": chat_completion.choices[0].message.content})
PROMPT.append({"role": "user", "content": f"Does the searchTerm: '{searchTerm}' have any brand info in it?" + "Answer in the given format: {'answer': 'Yes/No', 'reason': 'Reason for the answer'}"})
chat_completion = openAiClient.chat.completions.create(
response_format=RESPONSE_FORMAT,
messages=PROMPT,
model=MODEL,
)
print(f"Answer 2 -> Brand Present Check: {searchTerm}:{chat_completion.choices[0].message.content}")
isBrandAvailable = json.loads(chat_completion.choices[0].message.content)["answer"]
PROMPT.append({"role": "assistant", "content": chat_completion.choices[0].message.content})


if(isBrandAvailable == "Yes"):
# Check if the brand matches with the product
PROMPT.append({"role": "user", "content": f"Is the brand of the '{searchTerm}' and brand of '" + product['brand'] + " " + product['name'] + "' similar? If brands are similar answer 'Yes', If brands are different answer 'No'. Answer in the given format: {'answer': 'Yes/No', 'reason': 'Reason for the answer'} "})
chat_completion = openAiClient.chat.completions.create(
response_format=RESPONSE_FORMAT,
messages=PROMPT,
model=MODEL,
)
print(f"Answer 2.1 -> Brand Check: {product['name']} | {product['brand']} : {chat_completion.choices[0].message.content}")
isBrandSimilar = json.loads(chat_completion.choices[0].message.content)["answer"]
PROMPT.append({"role": "assistant", "content": chat_completion.choices[0].message.content})

# Continue with Accesory Check
PROMPT.append({"role": "user", "content": f"""Is the searchTerm: '{searchTerm}' an accessory of the {product['name']} or vice-versa? Answer 'Yes' only if they are not similar. Otherwise answer 'No'.
For example:
1. If the searchTerm is "mobile phone"; products such as "mobile cases", "screen protectors", "screen guards", "casing", "earphones" are accessories to mobile phones. Answer should be 'Yes'.
2. If the searchTerm is "mobile phone"; mobile phone, iphone 13, samsung s23 are all mobile phones. Answer should be 'No'.
3. If the searchTerm is "earphone"; Earphones, headphones, are all earphones. Answer should be 'No'
4. If the searchTerm is "cases"; mobile phone cases, casing, are all similar products. Answer should be 'No'

Make sure to double check the reason and then form the answer.""" +
"Answer in this format: {'answer': '', 'reason': ''}"})
chat_completion = openAiClient.chat.completions.create(
response_format=RESPONSE_FORMAT,
messages=PROMPT,
model=MODEL,
)
print(f"Answer 3 -> Accessory Present Check: {searchTerm} : {chat_completion.choices[0].message.content}")
accessoryReason = json.loads(chat_completion.choices[0].message.content)["reason"]
PROMPT.append({"role": "assistant", "content": "Reason: " + accessoryReason})
PROMPT.append({"role": "user", "content": f"Using the reason from the assistant above, is the product an accessory? If not, answer 'No' else answer 'Yes'." + "Answer in this format: {'answer': ''}"})
chat_completion = openAiClient.chat.completions.create(
response_format=RESPONSE_FORMAT,
messages=PROMPT,
model=MODEL,
)
isAccessory = json.loads(chat_completion.choices[0].message.content)["answer"]
PROMPT.append({"role": "assistant", "content": chat_completion.choices[0].message.content})
print(f"Answer 3.1 -> Accessory Check: {searchTerm} : {chat_completion.choices[0].message.content}")


# Check if the model details exists in the search term
PROMPT.append({"role": "user", "content": f"Does the searchTerm: '{searchTerm}' have any model info in it?" + "Answer in the given format: {'answer': 'Yes/No', 'reason': 'Reason for the answer'}"})
chat_completion = openAiClient.chat.completions.create(
response_format=RESPONSE_FORMAT,
messages=PROMPT,
model=MODEL,
)
print(f"Answer 4 -> Model Present Check for {searchTerm} : {chat_completion.choices[0].message.content}")
isModelAvailable = json.loads(chat_completion.choices[0].message.content)["answer"]
PROMPT.append({"role": "assistant", "content": chat_completion.choices[0].message.content})
if(isModelAvailable == "Yes"):
# Check if the model data matches with that of the product
PROMPT.append({"role": "user", "content": f"Is the model of the '{searchTerm}' and model of the '{product['name']}' similar? If models are similar and belong to the exact same series/version answer 'Yes', If models are different and belong to different series/version, answer 'No'. For eg: samsung s23 and samsung s24 are different models from different versions, answer 'No'. samsung s23 and samsung s23+ are different models from different versions, answer 'No'. iphone 15 and iphone 15 Pro are different versions, answer 'No'. Ignore attributes such as size, RAM, etc during comparison" + "Answer in the given format: {'answer': 'Yes/No', 'reason': 'Reason for the answer'} "})
chat_completion = openAiClient.chat.completions.create(
response_format=RESPONSE_FORMAT,
messages=PROMPT,
model=MODEL,
)
print(f"Answer 4.1 -> Model Check: for {product['name']} || {chat_completion.choices[0].message.content}")
modelReason = json.loads(chat_completion.choices[0].message.content)["reason"]
PROMPT.append({"role": "assistant", "content": modelReason})
PROMPT.append({"role": "user", "content": f"Using the reason from the assistant, is the model same?" + "Answer in the given format: {'answer': 'Yes/No', 'reason': 'Reason for the answer'}"})
chat_completion = openAiClient.chat.completions.create(
response_format=RESPONSE_FORMAT,
messages=PROMPT,
model=MODEL,
)
isModelSimilar = json.loads(chat_completion.choices[0].message.content)["answer"]
print(f"Answer 4.2 -> Model Check using reason: for {product['name']} || {chat_completion.choices[0].message.content}")
PROMPT.append({"role": "assistant", "content": chat_completion.choices[0].message.content})


# Check if colour info is available in the search term
PROMPT.append({"role": "user", "content": f"Does the searchTerm: '{searchTerm}' have any color info in it?" + "Answer in the given format: {'answer': 'Yes/No', 'reason': 'Reason for the answer'}"})
chat_completion = openAiClient.chat.completions.create(
response_format=RESPONSE_FORMAT,
messages=PROMPT,
model=MODEL,
)
print("Answer 5 -> Color Present Check: " + chat_completion.choices[0].message.content)
isColorAvailable = json.loads(chat_completion.choices[0].message.content)["answer"]
PROMPT.append({"role": "assistant", "content": chat_completion.choices[0].message.content})
if(isColorAvailable == "Yes"):
# Check if the colour info is same as in the product
PROMPT.append({"role": "user", "content": f"Is the color of the '{searchTerm}' and '{product}' similar? If colors are similar answer 'Yes', If colors are different answer 'No'" + "Answer in the given format: {'answer': 'Yes/No', 'reason': 'Reason for the answer'} "})
chat_completion = openAiClient.chat.completions.create(
response_format=RESPONSE_FORMAT,
messages=PROMPT,
model=MODEL,
)
print("Answer 5.1 -> Color Check: " + chat_completion.choices[0].message.content)
isColorSimilar = json.loads(chat_completion.choices[0].message.content)["answer"]
PROMPT.append({"role": "assistant", "content": chat_completion.choices[0].message.content})


# Now that we have all the info available, classify the products based on some if-else checks
if(isBrandAvailable == "Yes" and isBrandSimilar == "No"):
if (isAccessory):
reasonList.append("Accessory")
elif (isAccessory is False):
reasonList.append("Brand Mismatch")


elif(isBrandAvailable == "No" or (isBrandAvailable == "Yes" and isBrandSimilar == "Yes")):
if(isModelAvailable == "Yes"):
if(isModelSimilar == "Yes"):
if(isColorAvailable == "Yes"):
if(isColorSimilar == "Yes"):
if(isAccessory == "Yes"):
reasonList.append("Accessory")
elif(isColorSimilar == "No"):
reasonList.append("Color Mismatch")
elif(isColorAvailable == "No"):
if(isAccessory == "Yes"):
reasonList.append("Accessory")
elif(isModelSimilar == "No"):
reasonList.append("Model Mismatch")
elif(isModelAvailable == "No"):
if(isColorAvailable == "Yes"):
if(isColorSimilar == "Yes"):
if(isAccessory == "Yes"):
reasonList.append("Accessory")
elif(isColorSimilar == "No"):
reasonList.append("Color Mismatch")
elif(isColorAvailable == "No"):
if(isAccessory == "Yes"):
reasonList.append("Accessory")
elif(isCategorySimilar == "No"):
# As the category is not similar, the product is not relevant
reasonList.append("Category Mismatch")
if('Category Mismatch' in reasonList or 'Brand Mismatch' in reasonList):
resp['relevant'] = 'Not Relevant'
resp['auditReasons'] = " ".join(entry for entry in reasonList)
resp['reason'] = 'The query is specific in nature but the product does not belong to that category/brand'
elif(not reasonList):
resp['relevant'] = 'Relevant'
resp['auditReasons'] = []
resp['reason'] = 'Relevant'
else:
resp['relevant'] = 'Less Relevant'
resp['auditReasons'] = " ".join(entry for entry in reasonList)
resp['reason'] = 'Less Relevant'

Output:

Step-by-step classification done by LLM

The results were much much better and promising for the first few tries. I wanted to validate it for a much bigger set. So I did this for more than 500+ search terms and product combinations.

Sample result set

Total Number of search terms + product pairs: 500
Number of times where LLMs were consecutively consistent: 406​
Percentage: 81.2

Inference:

  1. LLMs did show inconsistency. Even after breaking down the tasks into smaller subtasks, LLMs were hallucinating.
  2. On further analysis, it seemed that LLMs were able to classify certain attributes such as category, brand, color, etc with great accuracy but struggled with other attributes such as accessory.
  3. Even with such a smaller test set, the percentage was quite low. Increasing the test set would show similar trends.
  4. I did try with different models such as Mistral 7B, Llama3 7B etc. The results were quite similar

Future Scope:

  1. Get more data points and do further analysis.​
  2. Enhance prompts where we’ve noted instances of LLMs hallucinating or providing inconsistent responses.
  3. Consider fine-tuning or substituting general LLMs with more specific LLMs trained on related classification tasks.

Even though the classification of the above problem statement wasn’t perfect, likely due to its complexity, there is significant potential in automating such classification tasks. As LLMs continue to evolve and improve, their accuracy and effectiveness in these tasks will also increase. However, it will be quite some time before LLMs are able to completely replace humans.

Have you tackled similar classification tasks or have insights to share on this topic? I’d love to hear your thoughts and ideas! Feel free to leave a comment or reach out directly.

Thank you for reading! If you enjoyed this article and found it helpful, your support such as likes, comments, or shares would mean a lot! If you’re looking to offer more support, consider buying me a coffee ☕💻🚀

--

--