Need help with a somehow easy request. I’m working on a solution that collects the subject from an emailhook and matches with a predefined set. As an example.
List of defined values are: Restaurant, Hotel, Travel, Grocery
The subject says “Rest”. then, it should return “Restaurant”.
Trying to do this with OpenAI or Parse, no luck. Any ideas??
not getting there. Im using Open AI Transform text to structured data, with following prompt:
Analyze the text and check for spelling mistakes and writing errors. Return one of the following values:
TRAVEL
TRANSPORTATION
FOOD
MATERIAL
LOCATIONS
PROFESSIONAL SERVICES
STUDY
INSURANCE
LEGAL
Examples:
If the text includes words like “flight,” “trip,” “itinerary,” “plane,” or similar, return “1. TRAVEL”
If the text includes words like “parking,” “fuel,” “refueling,” “blue zone,” “green zone,” or similar, return “2. TRANSPORTATION”
If the text includes words like “meals,” “restaurant,” “food,” “snack,” or similar, return “3. FOOD”
If the text includes words like “clothing,” “Zara,” “misc,” “props,” “accessories,” or similar, return “4. MATERIAL”
If the text includes words like “farmhouse,” “location,” “base,” or similar, return “5. LOCATIONS”
If the text includes words like “catering,” “runners,” “deliveries,” “hairdresser,” “esthetician,” “makeup,” or similar, return “6. PROFESSIONAL SERVICES”
If the text includes “study” or similar, return “7. STUDY”
If the text includes words like “insurance,” “protection,” “damage,” “coverage,” or similar, return “8. INSURANCE”
If the text includes words like “legal,” “contract,” “agreement,” or similar, return “9. LEGAL”
If the text is empty, contains “Fw,” or does not match any category, return “Others”.
The above looks good, but make it quite clear you want a JSON output, and define exactly how you want it. Also mention that your input data is email subjects that you’re wanting to classify, then put the text at the end with something like:
you were right! so before trying to structure the data, I added a creation completion Open AI module, to do the validation. then, after that its sent to Open AI create structured data, so that it can be easily mapped.