Skip to content

Commit

Permalink
modified: app/main.py
Browse files Browse the repository at this point in the history
	modified:   app/utils.py
  • Loading branch information
meilame-tayebjee committed Oct 9, 2024
1 parent 1caecee commit 9d9859c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class Config:
l'activité principale \
de l'entreprise (APE)",
version="0.0.1",
# root_path="/app",
)


Expand Down Expand Up @@ -249,6 +250,7 @@ async def predict_and_explain(
pred, confidence, all_scores = model.predict_and_explain(text, params)

response = process_response_explain(
text=text,
predictions=pred,
liasse_nb=0,
confidence=confidence,
Expand Down
5 changes: 3 additions & 2 deletions app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ def process_response(


def process_response_explain(
text: list[str],
predictions: list[list[str]],
liasse_nb: int,
confidence: list[list[float]],
Expand Down Expand Up @@ -341,8 +342,8 @@ def process_response_explain(
"libelle": libs[predictions[liasse_nb][-1].replace("__label__", "")],
}
}
for word in list(all_scores[liasse_nb].keys()):
output_dict[word] = all_scores[liasse_nb][word]

output_dict[text[liasse_nb]] = all_scores[liasse_nb]

try:
response = output_dict
Expand Down

0 comments on commit 9d9859c

Please sign in to comment.