-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
82 lines (71 loc) · 1.99 KB
/
Copy pathapp.py
File metadata and controls
82 lines (71 loc) · 1.99 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
from flask import Flask, request
from flask_cors import CORS, cross_origin
from ats_test3 import run_ats
from atspro import ATSModel
from gensim.models import Word2Vec
app = Flask(__name__)
model_f = Word2Vec.load('atstweaked2.model')
CORS(app)
@app.route("/")
def entry_point():
return "Base url"
@app.route("/test", methods=["POST"])
def test():
model = Word2Vec.load('atstweaked2.model')
sim = model.wv.similarity("business", "marketing")
sim_percentage = round((sim)*100, 2)
print(sim_percentage)
return {
"response": sim_percentage
}
@app.route("/test2", methods=["POST"])
def test2():
model = Word2Vec.load('atstweaked2.model')
return {
"response": "test 2"
}
@app.route("/test3", methods=["POST"])
def test3():
sim = model_f.wv.similarity("business", "marketing")
sim_percentage = round((sim)*100, 2)
print(sim_percentage)
return {
"response": sim_percentage
}
@app.route("/ats", methods=["GET", "POST"])
def ats():
if request.method == 'POST':
content = request.get_json()
resume_url = content.get('url')
keywords = content.get('keywords')
print("r ",resume_url)
keywords_arr = keywords.split(",")
result = run_ats(resume_url, keywords_arr)
print("Eligible ",result)
return {
"response": result
}
else:
return {
"response": "Nothing"
}
@app.route("/ats2", methods=["GET", "POST"])
def ats2():
if request.method == 'POST':
content = request.get_json()
resume_url = content.get('url')
keywords = content.get('keywords')
print("r ",resume_url)
keywords_arr = keywords.split(",")
result = run_ats(model_f, resume_url, keywords_arr)
print("Eligible ",result)
return {
"response": result
}
else:
return {
"response": "Nothing"
}
# main driver function
if __name__ == '__main__':
app.run()