Upload 3 files
Browse files- app.py +113 -0
- evaluation_dataset.csv +9 -0
- requirements.txt +5 -0
app.py
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import io
|
2 |
+
import os
|
3 |
+
import json
|
4 |
+
import streamlit as st
|
5 |
+
import pandas as pd
|
6 |
+
from google.oauth2 import service_account
|
7 |
+
from googleapiclient.discovery import build
|
8 |
+
from googleapiclient.http import MediaIoBaseDownload, MediaIoBaseUpload
|
9 |
+
|
10 |
+
# Environment variables
|
11 |
+
FOLDER_ID = os.getenv("FOLDER_ID")
|
12 |
+
GOOGLE_CREDENTIALS = os.environ.get("GOOGLE_CREDENTIALS")
|
13 |
+
|
14 |
+
def create_new_file_in_drive(username, dataframe_to_upload, credentials_json, folder_id):
|
15 |
+
"""Crée un nouveau fichier CSV dans Google Drive à partir d'un DataFrame Pandas."""
|
16 |
+
|
17 |
+
creds_dict = json.loads(credentials_json)
|
18 |
+
|
19 |
+
# Charger les informations d'identification du compte de service
|
20 |
+
creds = service_account.Credentials.from_service_account_info(creds_dict)
|
21 |
+
|
22 |
+
# Construire le service API Drive
|
23 |
+
service = build('drive', 'v3', credentials=creds)
|
24 |
+
|
25 |
+
# Convertir le DataFrame en fichier CSV en mémoire
|
26 |
+
csv_buffer = io.BytesIO()
|
27 |
+
dataframe_to_upload.to_csv(csv_buffer, index=False, sep=';', encoding='utf-8')
|
28 |
+
csv_buffer.seek(0)
|
29 |
+
|
30 |
+
# Créer les métadonnées du fichier
|
31 |
+
filename = f"rating-results-{username}.csv"
|
32 |
+
file_metadata = {
|
33 |
+
'name': filename,
|
34 |
+
'parents': [folder_id]
|
35 |
+
}
|
36 |
+
|
37 |
+
# Télécharger le fichier CSV sur Google Drive
|
38 |
+
media = MediaIoBaseUpload(csv_buffer, mimetype='text/csv', resumable=True)
|
39 |
+
file = service.files().create(body=file_metadata, media_body=media, fields='id').execute()
|
40 |
+
|
41 |
+
print(f"File '{filename}' created successfully.")
|
42 |
+
|
43 |
+
def main():
|
44 |
+
st.title("Problematic Rating App")
|
45 |
+
|
46 |
+
# Initialiser st.session_state.user et st.session_state.page si ce n'est pas déjà fait
|
47 |
+
if 'user' not in st.session_state:
|
48 |
+
st.session_state.user = None
|
49 |
+
if 'page' not in st.session_state:
|
50 |
+
st.session_state.page = 0 # 0 = page accueil, 1 = page notation
|
51 |
+
|
52 |
+
# Page d'accueil pour saisir le nom de l'utilisateur
|
53 |
+
if st.session_state.page == 0:
|
54 |
+
st.session_state.user = st.text_input("Enter your name:")
|
55 |
+
if st.session_state.user:
|
56 |
+
st.session_state.page = 1
|
57 |
+
st.rerun() # important
|
58 |
+
else:
|
59 |
+
st.stop()
|
60 |
+
|
61 |
+
# Charger le fichier CSV
|
62 |
+
try:
|
63 |
+
df = pd.read_csv("evaluation_dataset.csv", sep=';')
|
64 |
+
except FileNotFoundError:
|
65 |
+
st.error("evaluation_dataset.csv not found. Please upload the file.")
|
66 |
+
return
|
67 |
+
|
68 |
+
# Initialisation des variables de session
|
69 |
+
if 'problem_index' not in st.session_state:
|
70 |
+
st.session_state.problem_index = 0
|
71 |
+
if 'formulation_index' not in st.session_state:
|
72 |
+
st.session_state.formulation_index = 0
|
73 |
+
if 'results' not in st.session_state:
|
74 |
+
st.session_state.results = []
|
75 |
+
|
76 |
+
# Afficher la problématique à noter
|
77 |
+
if st.session_state.problem_index < len(df):
|
78 |
+
problem = df.iloc[st.session_state.problem_index]
|
79 |
+
formulation_types = ['original_form', 'perspective_shift', 'paraphrase', 'structural_transformation']
|
80 |
+
current_formulation = formulation_types[st.session_state.formulation_index]
|
81 |
+
st.write(f"Technical problem {st.session_state.problem_index + 1}/{len(df)}")
|
82 |
+
st.write(f"Formulation {st.session_state.formulation_index + 1}/4")
|
83 |
+
st.write(problem[current_formulation])
|
84 |
+
|
85 |
+
# Menu déroulant pour la notation
|
86 |
+
score = st.radio("Rate the problem:", options=[0, 1, 2, 3, 4, 5, "Don't know"], index=None,)
|
87 |
+
|
88 |
+
# Bouton pour passer à la formulation suivante ou à la problématique suivante
|
89 |
+
if st.button("Next"):
|
90 |
+
# Vérifier si le nom d'utilisateur est défini
|
91 |
+
if st.session_state.user:
|
92 |
+
st.session_state.results.append({
|
93 |
+
'user': st.session_state.user,
|
94 |
+
'formulation': current_formulation,
|
95 |
+
'problematic': problem[current_formulation],
|
96 |
+
'score': score
|
97 |
+
})
|
98 |
+
st.session_state.formulation_index += 1
|
99 |
+
if st.session_state.formulation_index == 4:
|
100 |
+
st.session_state.formulation_index = 0
|
101 |
+
st.session_state.problem_index += 1
|
102 |
+
st.rerun()
|
103 |
+
else:
|
104 |
+
st.warning("Please enter your name before proceeding.")
|
105 |
+
else:
|
106 |
+
# Afficher un message de remerciement et générer le fichier CSV
|
107 |
+
st.write("Thanks for rating the problems!")
|
108 |
+
st.session_state.results_df = pd.DataFrame(st.session_state.results)
|
109 |
+
create_new_file_in_drive(st.session_state.user, st.session_state.results_df, GOOGLE_CREDENTIALS, FOLDER_ID)
|
110 |
+
|
111 |
+
|
112 |
+
if __name__ == "__main__":
|
113 |
+
main()
|
evaluation_dataset.csv
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
original_form;perspective_shift;paraphrase;structural_transformation
|
2 |
+
How can passenger control of aircraft in-flight entertainment (IFE) systems be improved to overcome the disadvantage of complicated operation, particularly in selecting viewing content due to awkward placement and operation of passenger control units (PCUs), despite the existence of tethered and seatback-integrated PCU solutions?;Considering the awkwardness of passenger control units, are in-flight entertainment systems designed to be sufficiently user-friendly for passengers selecting content?;Can passenger operation of in-flight entertainment systems be made simpler, specifically regarding content selection difficulties arising from inconveniently designed and positioned passenger control units, despite existing tethered and integrated solutions?;To mitigate the challenge of intricate operation in passenger control of in-flight entertainment systems, particularly for content selection hampered by PCU placement and usability, what enhancements to passenger interaction could be implemented, even with tethered and seatback-integrated PCUs?
|
3 |
+
How can a satellite receiver processing a set of Automatic Identification System (AIS) signals, collected from dense maritime zones where numerous ships transmit simultaneously, overcome mutual signal blocking that prevents individual signal demodulation and compromises maritime safety, without requiring costly modifications to ship transmitters or a drastic increase in satellite payload complexity?;To effectively maintain maritime safety in congested zones characterized by overlapping Automatic Identification System signals, what detection method can a satellite receiver implement to resolve signal collisions without imposing significant cost burdens on shipboard communication systems or excessively complicating the satellite's processing capabilities?;Is it feasible for a satellite-based Automatic Identification System receiver, when handling a multitude of signals in high-density maritime environments where vessel transmissions occur concurrently, to mitigate mutual signal obstruction that hinders distinct signal recovery and jeopardizes safety at sea, without demanding substantial alterations to shipboard transmitting equipment or a considerable escalation in satellite payload sophistication?;Given the limitations of precluding expensive alterations to ship transmitters and preventing a significant rise in satellite payload intricacy, how might a satellite receiver, tasked with processing Automatic Identification System signals amidst the signal-dense environment of busy maritime regions where numerous ships are simultaneously broadcasting, successfully mitigate mutual signal blockage to ensure reliable individual signal demodulation and uphold maritime safety standards?
|
4 |
+
How can the pointing error of a satellite antenna be precisely and efficiently determined, accounting for thermo-elastic deformation of mechanical links, dynamic deformation of the satellite, and imperfect satellite attitude, without incurring the penalties of increased mass, power consumption, and complexity associated with dedicated RF sensing systems, while also surpassing the limited accuracy of methods relying solely on satellite attitude or the sensitivity and applicability constraints of signal-based methods like MUSIC?;Considering the limitations imposed by mass, power, and complexity constraints regarding dedicated RF sensing, and the insufficient precision of attitude-only methods alongside the sensitivity and applicability issues of signal-based techniques like MUSIC, is there a methodology capable of achieving precise and efficient determination of satellite antenna pointing error when accounting for thermo-elastic and dynamic deformations and imperfect satellite attitude?;Can one devise a technique to accurately and expeditiously evaluate the misalignment of a satellite antenna, taking into consideration thermal-mechanical distortions of mechanical links, structural dynamics of the satellite, and attitude inaccuracies, without incurring the penalties of increased mass, power consumption, and complexity associated with specialized RF sensors, and also outperforming the restricted precision of methods reliant solely on satellite attitude or the sensitivity and applicability limitations of signal processing techniques such as MUSIC?;To circumvent the penalties of increased mass, power draw, and complexity from dedicated RF sensing systems, while exceeding the accuracy limitations of attitude-only approaches and sensitivity constraints of signal-based methods like MUSIC, and still account for thermo-elastic deformation of mechanical links, dynamic satellite deformation, and imperfect satellite attitude, what strategy can be employed for precise and efficient satellite antenna pointing error determination?
|
5 |
+
How can contactless communication be enabled between two devices, both equipped with a display and a camera but lacking electromagnetic field-based contactless communication capabilities such as NFC or Wi-Fi, by utilizing an optical communication protocol that requires parameter negotiation?;For devices possessing displays and cameras but lacking NFC and Wi-Fi, what are the viable strategies for enabling optical contactless communication that depends on parameter negotiation?;Could we achieve touch-free data transfer between two devices, both fitted with a screen and a camera, but not equipped with NFC or Wi-Fi, by employing an optical protocol that mandates parameter agreement?;To facilitate parameter-negotiated optical communication between two devices – each with a display and camera, yet neither supporting NFC nor Wi-Fi – what methodology might be employed for establishing a contactless link?
|
6 |
+
How can automotive radar systems achieve sufficient sensitivity and angular resolution to reliably detect and discriminate between roadway infrastructure and stationary vehicles at extended ranges (greater than 200m) while minimizing false alarms that could trigger unnecessary emergency maneuvers, and simultaneously maintaining a simple antenna architecture, limiting processing volume, and ensuring affordability for widespread automotive deployment?;What are the key design hurdles in creating automotive radar systems capable of robustly identifying and distinguishing between road features and parked cars at distances exceeding 200 meters with adequate sensitivity and angular resolution, while also minimizing spurious detections that might activate unwarranted emergency braking, and concurrently being cost-effective, computationally light, and employing a basic antenna setup suitable for mass automotive adoption?;Could automotive radar systems be engineered to offer the required sensitivity and angular precision for the reliable long-distance (over 200m) recognition of road infrastructure and static vehicles, alongside a reduction in false positives that could initiate avoidable emergency responses, and at the same time, preserve a basic antenna configuration, low processing overhead, and an accessible price point for common vehicle integration?;For the purpose of broad automotive integration, is it feasible to develop affordable radar systems with uncomplicated antennas and low processing needs, that nonetheless achieve the necessary sensitivity and angular resolution to effectively differentiate between stationary vehicles and roadway infrastructure at ranges beyond 200m and avoid false alarms that could trigger needless emergency braking?
|
7 |
+
How can redundant communication networks of the Ethernet full-duplex switched type, particularly those employing redundancy management methods similar to FR 2,864,393 B1, be made more robust against cyber-attacks that compromise elementary networks, thereby enhancing cybersecurity beyond the capabilities of current redundancy management approaches?;What enhancements to redundancy management strategies, akin to FR 2,864,393 B1, are needed to better defend redundant Ethernet full-duplex switched networks against cyber-attacks targeting fundamental network components, thereby exceeding the security offered by existing methods?;Could backup communication networks of the Ethernet full-duplex switched variety, especially those employing fault tolerance techniques comparable to FR 2,864,393 B1, be rendered more resilient against digital intrusions that compromise foundational networks, to elevate network security beyond the scope of present fault tolerance solutions?;To achieve superior cybersecurity for redundant Ethernet full-duplex switched networks, particularly those utilizing redundancy management techniques such as FR 2,864,393 B1, against cyber-attacks targeting core networks, what specific steps can be implemented to bolster their resilience?
|
8 |
+
"How can cryptographic devices, particularly low-cost devices requiring high tamper resistance, effectively protect secret keys stored in hardware key registers from fault attacks (such as bit-flipping attacks) that aim to extract these keys by exploiting the ""use-it"" or ""load-it"" nature of key registers, given the inadequacy of existing protection methods like physically secure rooms and offline countermeasures, and considering the vulnerabilities of even strong ciphers like triple DES to such physical perturbations, while avoiding the performance and efficiency penalties associated with redundancy-based countermeasures?";What are the fundamental challenges in establishing robust security for confidential keys housed in hardware registers of economical cryptographic devices against fault-based attacks, considering the limitations of conventional security measures and the performance overhead associated with redundancy-based defenses?;Could effective methodologies be devised to safeguard cryptographic secrets stored within the hardware memory of budget-constrained devices, specifically from fault injection techniques like bit manipulation, given the recognized inadequacies of physical and offline protection strategies, and the susceptibility of even powerful ciphers such as triple DES to physical disturbances, without incurring unacceptable performance degradation?;"Acknowledging the inherent ""use-it"" and ""load-it"" vulnerabilities of key registers in low-cost, tamper-resistant cryptographic devices, the proven ineffectiveness of physically secure environments and offline countermeasures, and the susceptibility of robust encryption algorithms to physical perturbations, are there alternative security paradigms, beyond redundancy, that can effectively shield secret keys from fault attacks like bit-flipping?"
|
9 |
+
How can software configuration and download for line replaceable units (LRUs) within restricted architecture networks, particularly in in-flight entertainment systems (IFES), be performed more efficiently and reliably than with conventional serial and sequential methods, to ensure perfectly consistent and reproducible software configurations across a large number of LRUs within limited maintenance time windows and under stringent regulatory requirements?;To guarantee enhanced efficiency and dependability in software setup and download for LRUs within IFES restricted networks, beyond traditional serial techniques, what strategies can ensure perfectly uniform software configurations across numerous units under tight maintenance and regulation?;Could there be a more rapid and dependable process, other than standard sequential approaches, to set up and download software for replaceable hardware in constrained IFES networks, ensuring uniform and repeatable program setups across many LRUs with short maintenance times and strict rules?;Given the limitations of restricted architectures within in-flight entertainment systems, alongside the necessity for consistent software across a large number of LRUs and brief maintenance windows under strict regulatory demands, is there a more effective and dependable alternative to serial and sequential methods for software configuration and download?
|
requirements.txt
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
streamlit==1.42.0
|
2 |
+
pandas==2.2.3
|
3 |
+
google-api-python-client
|
4 |
+
google-auth-httplib2
|
5 |
+
google-auth-oauthlib
|