HinaCortus commited on
Commit
fa9e886
1 Parent(s): 652d27e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -6,6 +6,8 @@ from model.model import __version__ as model_version
6
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
7
  from transformers import TextClassificationPipeline
8
 
 
 
9
  app = FastAPI()
10
 
11
 
@@ -71,6 +73,8 @@ def whichsocial(request):
71
  # https://hinacortus-api-knowyouraudience.hf.space/content/https://www.20minutes.fr/auto/4039741-20230604-vente-encheres-citroen-2cv-bois-unique-monde-adjugee-210-000-euros
72
  @app.get("/content/{request}")
73
  def analyzecontent(request):
74
- content = requests.request.text
75
- len_content = len(request.split(' '))
76
  return {"number_of_word":len_content}
 
 
 
6
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
7
  from transformers import TextClassificationPipeline
8
 
9
+ import requests
10
+
11
  app = FastAPI()
12
 
13
 
 
73
  # https://hinacortus-api-knowyouraudience.hf.space/content/https://www.20minutes.fr/auto/4039741-20230604-vente-encheres-citroen-2cv-bois-unique-monde-adjugee-210-000-euros
74
  @app.get("/content/{request}")
75
  def analyzecontent(request):
76
+ content = requests.get(request.text)
77
+ len_content = len(content.split(' '))
78
  return {"number_of_word":len_content}
79
+
80
+