#How do I integrate a Hugging Face AI into a Spring Boot application?
1 messages · Page 1 of 1 (latest)
Here is an AI assisted attempt to answer your question 🤖. Maybe it helps! In any case, a human is on the way 👍. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.
Your task involves integrating a Hugging Face model for classifying comments as support tickets and generating tickets accordingly. Rather than rewriting your code, focus on these key areas when reviewing or improving your existing Spring application:
- Model Integration: Ensure your Spring service correctly calls the Hugging Face API or loads the model locally using an appropriate client (e.g., Hugging Face’s Java SDK or REST API). Verify proper handling of input and output format expected by the model.
- Asynchronous Processing: Since model inference can be slow, consider using
@Asyncor a message queue to avoid blocking HTTP request threads. - Validation & Error Handling: Validate input comments, handle API errors, and manage fallback cases gracefully within the service layer.
- Ticket Generation Logic: Confirm that once a comment is classified as a support ticket, the system reliably creates and persists ticket entities, possibly leveraging Spring Data repositories.
- Security: Secure API keys or tokens used to access the Hugging Face model and sanitize input to prevent injection attacks.
- Testing: Add unit tests/mock tests for your integration points and classification logic to ensure robustness.
By focusing on these concepts using your old code as a reference, you can ensure a clean, maintainable integration.
Useful links:
Problem is, I have no idea what I'm doing
u sure this is the right position for you when ur not able to nail the actual homework test?
just saying
Let's leave aside the hugging face part for minute
How would you know if a comment should be a support ticket
Look, I probably already failed
I botched the first coding exercise, so I'm probably not getting the position
In reality I don't know why they even sent me a second assignment
But, I know that if I apply to more interships for fullstack or backend web page development, I will get another exercise like this
Not the exact same one, but similar
And if I don't figure out how to do it now, I never will
I can promise not to even send this to them, even send them an email saying that I decided to stop applying for the position
But I need to know how this works
So I can actually do it the future
By it's contents
An AI would read through it and decide whether or not it should be a support ticket
There's probably a way to give it like... a directive or something
Give it a criteria for what should constitute creating a support ticket
I dunno
I was never taught anything about this in my coding school
We were taught how to make front-end and back-end applications with React.js and Spring Boot
I don't know anything about... this...
To answer your question, I don't think this position is right for me
Not right now at least...
But I can try to learn so I am actually qualified for the next one
Well let's reason from first principles then
AI models basically give us a way to - with some known or unknown probability - label parts of or the entirety of some data
What you want here is called a classifier. You want to classify comments into "should be a support ticket" and "should not be a support ticket"
But we don't get to skip thinking about what would put something into one of those buckets
Let me try to come up with some criteria for comment ticket flaging a creation then
- A user encounters a bug or a glitch, aka. the application isn't working properly. For example:
"Clicking on the log in button the main page takes me to a white page with nothing on it"
"Entering the main page, all of the text is sideways" - A feature suggestion:
"A good feature to add would be sorting by categories, which would finding what you're looking for easier" - Someone has questions about billing:
"My debit card was charged even though I cancelled my subscribtion" - Account issues:
"I lost access to my account"
"I forgot my password"
"I cannot change my email, I no longer use the one connected to my account" - Other(Anything that is an issue that someone is having with the application that doesn't fall under the other categories. Keywords to look out for would be "issue", "problem", etc.)
I based my filtering criteria on the categories that the Ticket itself has
Okay so now let's go over the strategies for bucketing things like that
Simplest strategy you can come up with. Keyword filtering
Or just sentence fragments
If the post has these words then it is one of the categories
One layer above that is to do something we call natural language processing
So you have a program that can intelligently pull out things like stems and whatnot
So just slightly above keyword filtering
A step above that is instead of using keyword filtering, use a classifier model
To make the simplest of these you need a lot of examples
I think I'd rather go for the classifier model
It sounds like it will do the job it needs to do better
I don't have time rn, someone explain regression models to this person
How do I integrate a Hugging Face API into a Spring Boot application?