pradelf commited on
Commit
83f0f75
·
1 Parent(s): 41c36a3

add articles CSV file for test with API, Data Science, and Cybersecurity entries

Browse files
Files changed (2) hide show
  1. app.py +47 -1
  2. data/articles.csv +16 -0
app.py CHANGED
@@ -3,7 +3,53 @@ from pydantic import BaseModel
3
  import mlflow.pyfunc
4
  import pandas as pd
5
 
6
- app = FastAPI()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
 
8
 
9
  @app.get("/")
 
3
  import mlflow.pyfunc
4
  import pandas as pd
5
 
6
+ description = """
7
+ Bienvenue sur l'API de Getaround pour prédire le prix journalier de location d'une voiture en fonction de son année d'expérience!
8
+
9
+ ## Point de terminaison d'introduction
10
+
11
+ Pour tester le fonctionnement de l'API, vous pouvez utiliser le point de terminaison d'introduction suivant:
12
+ * `/`: **GET** retourne la version de l'API et un message de bienvenue.
13
+
14
+ ## Point de terminaison du prix de location
15
+
16
+ Cette API permet de prédire le prix journalier de location d'une voiture.
17
+ * `/price/{car_id}`: **GET** retourne le prix journalier de location d'une voiture en fonction de son identifiant.
18
+
19
+
20
+ ## Machine Learning
21
+
22
+ Cette terminaison de l'API permet de prédire le prix journalier de location d'une voiture en fonction de ses caractéristiques..
23
+
24
+ * `/predict` accepte une requête POST avec un JSON contenant une clé `YearsExperience` et retourne une prédiction du prix journalier de location d'une voiture.
25
+
26
+
27
+ Check out documentation below 👇 for more information on each endpoint.
28
+ """
29
+ tags_metadata = [
30
+ {
31
+ "name": "Point de terminaison d'introduction",
32
+ "description": "Terminaison simple de test",
33
+ },
34
+ {
35
+ "name": "Terminaison du prix de location",
36
+ "description": "Point de terminaison pour obtenir le tarif journalier par **GET** d'une voiture en focntion de son identifiant.",
37
+ },
38
+ {
39
+ "name": "Machine Learning",
40
+ "description": "Prediction du prix de location journalier d'un véhicule en fonction de ses caractéristiques.",
41
+ },
42
+ ]
43
+ app = FastAPI(
44
+ title="Getaround API pour le prix journalier de location d'une voiture.",
45
+ description=description,
46
+ version="0.1",
47
+ contact={
48
+ "name": "Francis Pradel",
49
+ "url": "https://promotion.francispradel.fr",
50
+ },
51
+ openapi_tags=tags_metadata,
52
+ )
53
 
54
 
55
  @app.get("/")
data/articles.csv ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ id,title,content,author
2
+ 1,API,"An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software.[1] A document or standard that describes how to build or use such a connection or interface is called an API specification. A computer system that meets this standard is said to implement or expose an API. The term API may refer either to the specification or to the implementation.
3
+
4
+ In contrast to a user interface, which connects a computer to a person, an application programming interface connects computers or pieces of software to each other. It is not intended to be used directly by a person (the end user) other than a computer programmer who is incorporating it into software. An API is often made up of different parts which act as tools or services that are available to the programmer. A program or a programmer that uses one of these parts is said to call that portion of the API. The calls that make up the API are also known as subroutines, methods, requests, or endpoints. An API specification defines these calls, meaning that it explains how to use or implement them.
5
+
6
+ One purpose of APIs is to hide the internal details of how a system works, exposing only those parts a programmer will find useful and keeping them consistent even if the internal details later change. An API may be custom-built for a particular pair of systems, or it may be a shared standard allowing interoperability among many systems.
7
+
8
+ The term API is often used to refer to web APIs,[2] which allow communication between computers that are joined by the internet. There are also APIs for programming languages, software libraries, computer operating systems, and computer hardware. APIs originated in the 1940s, though the term did not emerge until the 1960s and 70s.",Wikipedia
9
+ 2,Data Science,"Data science is an interdisciplinary field that uses scientific methods, processes, algorithms and systems to extract knowledge and insights from noisy, structured and unstructured data,[1][2] and apply knowledge and actionable insights from data across a broad range of application domains. Data science is related to data mining, machine learning and big data.
10
+
11
+ Data science is a ""concept to unify statistics, data analysis, informatics, and their related methods"" in order to ""understand and analyze actual phenomena"" with data.[3] It uses techniques and theories drawn from many fields within the context of mathematics, statistics, computer science, information science, and domain knowledge. However, data science is different from computer science and information science. Turing Award winner Jim Gray imagined data science as a ""fourth paradigm"" of science (empirical, theoretical, computational, and now data-driven) and asserted that ""everything about science is changing because of the impact of information technology"" and the data deluge.[4][5]
12
+
13
+ A data scientist is someone who creates programming code, and combines it with statistical knowledge to create insights from data.",Wikipedia
14
+ 3,Cybersecurity,"Cybersecurity is the practice of protecting systems, networks, and programs from digital attacks. These cyberattacks are usually aimed at accessing, changing, or destroying sensitive information; extorting money from users; or interrupting normal business processes.
15
+
16
+ Implementing effective cybersecurity measures is particularly challenging today because there are more devices than people, and attackers are becoming more innovative.",Cisco