0% found this document useful (0 votes)
7 views3 pages

Resume Screening API

The document outlines an AI-powered resume screening application built with Spring Boot, featuring a controller layer for handling resume uploads, a service layer for text extraction and analysis using OpenAI, and a DTO layer for data transfer. The application allows users to submit a resume and job description, which is then analyzed to provide feedback on the resume's alignment with the job requirements. Additionally, it includes a configuration layer for setting up necessary beans like RestTemplate.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

Resume Screening API

The document outlines an AI-powered resume screening application built with Spring Boot, featuring a controller layer for handling resume uploads, a service layer for text extraction and analysis using OpenAI, and a DTO layer for data transfer. The application allows users to submit a resume and job description, which is then analyzed to provide feedback on the resume's alignment with the job requirements. Additionally, it includes a configuration layer for setting up necessary beans like RestTemplate.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

AI-Powered Resume Screening with Spring Boot

Controller Layer
package [Link];

import [Link];
import [Link];
import [Link];
import [Link];
import [Link].*;
import [Link];

import [Link];

@RestController
@RequestMapping("/api/resume")
public class ResumeController {

@Autowired
private ResumeScreeningService resumeScreeningService;

@PostMapping("/analyze")
public ResumeResponse analyzeResume(@RequestParam("file") MultipartFile file,
@RequestBody ResumeRequest request) throws IOException {
String extractedText = [Link](file);
String aiAnalysis = [Link](extractedText,
[Link]());
return new ResumeResponse(aiAnalysis);
}
}

Service Layer
package [Link];

import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

import [Link];

@Service
public class ResumeScreeningService {

private final OpenAiService openAiService;


private final Tika tika;
public ResumeScreeningService(@Value("${[Link]}") String apiKey) {
[Link] = new OpenAiService(apiKey);
[Link] = new Tika();
}

public String extractTextFromResume(MultipartFile file) throws IOException {


return [Link]([Link]());
}

public String analyzeResume(String resumeText, String jobDescription) {


String prompt = "Compare the following resume with this job description: " +
jobDescription + "\n Resume: " + resumeText;

CompletionRequest request = [Link]()


.model("gpt-3.5-turbo")
.prompt(prompt)
.maxTokens(150)
.temperature(0.7)
.build();

CompletionResult result = [Link](request);


return [Link]().get(0).getText().trim();
}
}

DTO Layer
package [Link];

public class ResumeRequest {


private String jobDescription;

public String getJobDescription() {


return jobDescription;
}

public void setJobDescription(String jobDescription) {


[Link] = jobDescription;
}
}

public class ResumeResponse {


private String analysis;

public ResumeResponse(String analysis) {


[Link] = analysis;
}

public String getAnalysis() {


return analysis;
}

public void setAnalysis(String analysis) {


[Link] = analysis;
}
}

Configuration Layer
package [Link];

import [Link];
import [Link];
import [Link];

@Configuration
public class AppConfig {
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
}
}

You might also like