forked from srbhr/Resume-Matcher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
resume_processor.py
44 lines (29 loc) · 851 Bytes
/
resume_processor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from typing import List, Optional
from fastapi import File, Form, UploadFile
from pydantic import BaseModel
class Job(BaseModel):
id: str
link: Optional[str] = None
description: Optional[str] = None
class ResumeProcessorRequest(BaseModel):
resume: UploadFile
jobs: str
@classmethod
def as_form(cls, resume: UploadFile = File(...), jobs: str = Form(...)):
return cls(resume=resume, jobs=jobs)
class VectorScore(BaseModel):
jobId: str
score: int
class CommonWord(BaseModel):
jobId: str
text: str
class Changes(BaseModel):
changeFrom: str
changeTo: str
class Suggestion(BaseModel):
jobId: str
changes: List[Changes]
class ResumeProcessorResponse(BaseModel):
vectorScoresSet: List[VectorScore]
commonWordsSet: List[CommonWord]
suggestionsSet: List[Suggestion]