Ahmad Shallouf
commited on
Commit
β’
ee2bc67
1
Parent(s):
28d1959
added backend
Browse files- .idea/copilot/chatSessions/00000000000.xd +0 -0
- .idea/copilot/chatSessions/blobs/version +0 -0
- .idea/copilot/chatSessions/xd.lck +0 -140
- .idea/dataSources.xml +7 -0
- .idea/misc.xml +3 -0
- .idea/workspace.xml +45 -2
- Backend/CQI_Leaderboard.csv +3 -0
- Backend/Dockerfile +14 -0
- Backend/database_service.py +133 -0
- docker-compose.yaml β Backend/docker-compose.yaml +9 -3
- Backend/main.py +28 -0
- Backend/requirements.txt +7 -0
- CQI_Leaderboard.csv +0 -3
- leaderboard.py β Frontend/leaderboard.py +0 -0
- Frontend/submission.py +50 -0
- __pycache__/app.cpython-39.pyc +0 -0
- app.py +7 -6
- database_service.py +0 -0
- requirements.txt +6 -1
- submission.py +0 -0
.idea/copilot/chatSessions/00000000000.xd
DELETED
Binary file (5.44 kB)
|
|
.idea/copilot/chatSessions/blobs/version
DELETED
Binary file (4 Bytes)
|
|
.idea/copilot/chatSessions/xd.lck
DELETED
@@ -1,140 +0,0 @@
|
|
1 |
-
Private property of Exodus: 53615@Ahmads-MBP
|
2 |
-
|
3 |
-
jetbrains.exodus.io.LockingManager.lock(LockingManager.kt:88)
|
4 |
-
jetbrains.exodus.io.LockingManager.lock(LockingManager.kt:39)
|
5 |
-
jetbrains.exodus.io.FileDataWriter.lock(FileDataWriter.kt:70)
|
6 |
-
jetbrains.exodus.log.Log.tryLock(Log.kt:804)
|
7 |
-
jetbrains.exodus.log.Log.<init>(Log.kt:117)
|
8 |
-
jetbrains.exodus.env.Environments.newLogInstance(Environments.kt:117)
|
9 |
-
jetbrains.exodus.env.Environments.newLogInstance(Environments.kt:81)
|
10 |
-
jetbrains.exodus.env.Environments.newLogInstance(Environments.kt:77)
|
11 |
-
jetbrains.exodus.env.Environments$newInstance$4.invoke(Environments.kt:46)
|
12 |
-
jetbrains.exodus.env.Environments$newInstance$4.invoke(Environments.kt:46)
|
13 |
-
jetbrains.exodus.env.Environments.prepare(Environments.kt:120)
|
14 |
-
jetbrains.exodus.env.Environments.newInstance(Environments.kt:46)
|
15 |
-
kotlinx.dnq.store.container.EntityStoreHelperKt.createTransientEntityStore(EntityStoreHelper.kt:40)
|
16 |
-
kotlinx.dnq.store.container.EntityStoreHelperKt.createTransientEntityStore(EntityStoreHelper.kt:31)
|
17 |
-
kotlinx.dnq.store.container.EntityStoreHelperKt.createTransientEntityStore$default(EntityStoreHelper.kt:30)
|
18 |
-
com.github.copilot.chat.session.persistence.xodus.XdChatSessionPersistenceService.initStore(XdChatSessionPersistenceService.kt:115)
|
19 |
-
com.github.copilot.chat.session.persistence.xodus.XdChatSessionPersistenceService.<init>(XdChatSessionPersistenceService.kt:22)
|
20 |
-
com.github.copilot.chat.session.persistence.xodus.XdChatSessionPersistenceService.<init>(XdChatSessionPersistenceService.kt:15)
|
21 |
-
com.github.copilot.chat.session.persistence.ChatSessionPersistenceServiceKt.ChatSessionPersistenceService(ChatSessionPersistenceService.kt:43)
|
22 |
-
com.github.copilot.chat.session.persistence.ChatSessionPersistenceServiceKt.chatSessionsPersistenceService(ChatSessionPersistenceService.kt:53)
|
23 |
-
com.github.copilot.chat.session.ChatSessionManager.<init>(ChatSessionManager.kt:45)
|
24 |
-
com.github.copilot.chat.session.ChatSessionManager.<init>(ChatSessionManager.kt:25)
|
25 |
-
com.github.copilot.chat.window.CopilotChatToolWindow.onCopilotReady(CopilotChatToolWindow.kt:133)
|
26 |
-
com.github.copilot.chat.window.CopilotChatToolWindow.access$onCopilotReady(CopilotChatToolWindow.kt:40)
|
27 |
-
com.github.copilot.chat.window.CopilotChatToolWindow$initCopilotStatusListener$1.invoke(CopilotChatToolWindow.kt:118)
|
28 |
-
com.github.copilot.chat.window.CopilotChatToolWindow$initCopilotStatusListener$1.invoke(CopilotChatToolWindow.kt:115)
|
29 |
-
com.github.copilot.status.CopilotAuthStatusKt.subscribeToCopilotAuthStatus(CopilotAuthStatus.kt:27)
|
30 |
-
com.github.copilot.chat.window.CopilotChatToolWindow.initCopilotStatusListener(CopilotChatToolWindow.kt:115)
|
31 |
-
com.github.copilot.chat.window.CopilotChatToolWindow.<init>(CopilotChatToolWindow.kt:59)
|
32 |
-
com.github.copilot.chat.window.CopilotChatToolWindow.<init>(CopilotChatToolWindow.kt:40)
|
33 |
-
com.github.copilot.chat.window.CopilotChatToolWindowFactory.init(CopilotChatToolWindowFactory.kt:18)
|
34 |
-
com.intellij.openapi.wm.impl.ToolWindowManagerImpl.registerToolWindow$intellij_platform_ide_impl(ToolWindowManagerImpl.kt:1123)
|
35 |
-
com.intellij.toolWindow.ToolWindowSetInitializerKt.registerToolWindows(ToolWindowSetInitializer.kt:223)
|
36 |
-
com.intellij.toolWindow.ToolWindowSetInitializerKt.access$registerToolWindows(ToolWindowSetInitializer.kt:1)
|
37 |
-
com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1$1.invokeSuspend(ToolWindowSetInitializer.kt:141)
|
38 |
-
com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1$1.invoke(ToolWindowSetInitializer.kt)
|
39 |
-
com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1$1.invoke(ToolWindowSetInitializer.kt)
|
40 |
-
kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
|
41 |
-
kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
|
42 |
-
kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
|
43 |
-
com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span(tracer.kt:53)
|
44 |
-
com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span$default(tracer.kt:49)
|
45 |
-
com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1.invokeSuspend(ToolWindowSetInitializer.kt:138)
|
46 |
-
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
|
47 |
-
kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
|
48 |
-
com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:194)
|
49 |
-
com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:843)
|
50 |
-
com.intellij.openapi.application.impl.ApplicationImpl$4.run(ApplicationImpl.java:463)
|
51 |
-
com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:75)
|
52 |
-
com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:67)
|
53 |
-
com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1436)
|
54 |
-
com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:82)
|
55 |
-
com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:124)
|
56 |
-
com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:44)
|
57 |
-
java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
|
58 |
-
java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
|
59 |
-
java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
|
60 |
-
java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
|
61 |
-
java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
|
62 |
-
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
|
63 |
-
java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761)
|
64 |
-
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:695)
|
65 |
-
com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$12(IdeEventQueue.kt:589)
|
66 |
-
com.intellij.openapi.application.impl.RwLockHolder.runWithoutImplicitRead(RwLockHolder.kt:44)
|
67 |
-
com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:589)
|
68 |
-
com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:72)
|
69 |
-
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:355)
|
70 |
-
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:354)
|
71 |
-
com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:793)
|
72 |
-
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:354)
|
73 |
-
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:349)
|
74 |
-
com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1014)
|
75 |
-
com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114)
|
76 |
-
com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1014)
|
77 |
-
com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:349)
|
78 |
-
com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:843)
|
79 |
-
com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:391)
|
80 |
-
com.intellij.openapi.progress.impl.PlatformTaskSupportKt.pumpEventsForHierarchy(PlatformTaskSupport.kt:396)
|
81 |
-
com.intellij.openapi.progress.impl.PlatformTaskSupportKt.access$pumpEventsForHierarchy(PlatformTaskSupport.kt:1)
|
82 |
-
com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$2.invoke(PlatformTaskSupport.kt:156)
|
83 |
-
com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$2.invoke(PlatformTaskSupport.kt:134)
|
84 |
-
com.intellij.openapi.application.impl.ModalityKt.inModalContext(modality.kt:12)
|
85 |
-
com.intellij.openapi.progress.impl.PlatformTaskSupport.runWithModalProgressBlockingInternal(PlatformTaskSupport.kt:134)
|
86 |
-
com.intellij.openapi.progress.impl.PlatformTaskSupport.access$runWithModalProgressBlockingInternal(PlatformTaskSupport.kt:48)
|
87 |
-
com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$1.invoke(PlatformTaskSupport.kt:122)
|
88 |
-
com.intellij.openapi.progress.impl.PlatformTaskSupport$runWithModalProgressBlockingInternal$1.invoke(PlatformTaskSupport.kt:118)
|
89 |
-
com.intellij.openapi.progress.ContextKt.prepareThreadContext(context.kt:86)
|
90 |
-
com.intellij.openapi.progress.impl.PlatformTaskSupport.runWithModalProgressBlockingInternal(PlatformTaskSupport.kt:118)
|
91 |
-
com.intellij.platform.ide.progress.TasksKt.runWithModalProgressBlocking(tasks.kt:173)
|
92 |
-
com.intellij.platform.ide.progress.TasksKt.runWithModalProgressBlocking$default(tasks.kt:167)
|
93 |
-
com.intellij.ide.actions.OpenFileAction$actionPerformed$1.invoke(OpenFileAction.kt:85)
|
94 |
-
com.intellij.ide.actions.OpenFileAction$actionPerformed$1.invoke(OpenFileAction.kt:76)
|
95 |
-
com.intellij.ide.actions.OpenFileAction.actionPerformed$lambda$0(OpenFileAction.kt:76)
|
96 |
-
com.intellij.ui.mac.MacPathChooserDialog.choose(MacPathChooserDialog.java:153)
|
97 |
-
com.intellij.openapi.fileChooser.FileChooser.chooseFiles(FileChooser.java:100)
|
98 |
-
com.intellij.openapi.fileChooser.FileChooser.chooseFiles(FileChooser.java:78)
|
99 |
-
com.intellij.ide.actions.OpenFileAction.actionPerformed(OpenFileAction.kt:76)
|
100 |
-
com.intellij.openapi.actionSystem.ex.ActionUtil.doPerformActionOrShowPopup(ActionUtil.java:344)
|
101 |
-
com.intellij.openapi.actionSystem.ex.ActionUtil.lambda$performActionDumbAwareWithCallbacks$4(ActionUtil.java:318)
|
102 |
-
com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.java:381)
|
103 |
-
com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:318)
|
104 |
-
com.intellij.platform.ide.menu.MacNativeActionMenuItemKt.performAction$lambda$1(MacNativeActionMenuItem.kt:140)
|
105 |
-
com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:222)
|
106 |
-
com.intellij.platform.ide.menu.MacNativeActionMenuItemKt.performAction(MacNativeActionMenuItem.kt:128)
|
107 |
-
com.intellij.platform.ide.menu.MacNativeActionMenuItemKt.access$performAction(MacNativeActionMenuItem.kt:1)
|
108 |
-
com.intellij.platform.ide.menu.MacNativeActionMenuItem.lambda$2$lambda$1$lambda$0(MacNativeActionMenuItem.kt:82)
|
109 |
-
com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:114)
|
110 |
-
com.intellij.openapi.application.TransactionGuardImpl.performUserActivity(TransactionGuardImpl.java:95)
|
111 |
-
com.intellij.platform.ide.menu.MacNativeActionMenuItem.lambda$2$lambda$1(MacNativeActionMenuItem.kt:81)
|
112 |
-
java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
|
113 |
-
java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
|
114 |
-
java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
|
115 |
-
java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
|
116 |
-
java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
|
117 |
-
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
|
118 |
-
java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761)
|
119 |
-
com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:695)
|
120 |
-
com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$12(IdeEventQueue.kt:589)
|
121 |
-
com.intellij.openapi.application.impl.RwLockHolder.runWithoutImplicitRead(RwLockHolder.kt:44)
|
122 |
-
com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:589)
|
123 |
-
com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:72)
|
124 |
-
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:355)
|
125 |
-
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:354)
|
126 |
-
com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:793)
|
127 |
-
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:354)
|
128 |
-
com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:349)
|
129 |
-
com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1014)
|
130 |
-
com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
|
131 |
-
com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1014)
|
132 |
-
com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:349)
|
133 |
-
com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:848)
|
134 |
-
com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:391)
|
135 |
-
java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
|
136 |
-
java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
|
137 |
-
java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
|
138 |
-
java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
|
139 |
-
java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
|
140 |
-
java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.idea/dataSources.xml
CHANGED
@@ -8,5 +8,12 @@
|
|
8 |
<jdbc-url>jdbc:postgresql://localhost:15563/postgres</jdbc-url>
|
9 |
<working-dir>$ProjectFileDir$</working-dir>
|
10 |
</data-source>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
</component>
|
12 |
</project>
|
|
|
8 |
<jdbc-url>jdbc:postgresql://localhost:15563/postgres</jdbc-url>
|
9 |
<working-dir>$ProjectFileDir$</working-dir>
|
10 |
</data-source>
|
11 |
+
<data-source source="LOCAL" name="@cam-v2-compuge-db.ltdemos.informatik.uni-hamburg.de" uuid="d27760f8-7a8d-4bc9-9c38-199d22192414">
|
12 |
+
<driver-ref>postgresql</driver-ref>
|
13 |
+
<synchronize>true</synchronize>
|
14 |
+
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
|
15 |
+
<jdbc-url>jdbc:postgresql://cam-v2-compuge-db.ltdemos.informatik.uni-hamburg.de:443/</jdbc-url>
|
16 |
+
<working-dir>$ProjectFileDir$</working-dir>
|
17 |
+
</data-source>
|
18 |
</component>
|
19 |
</project>
|
.idea/misc.xml
CHANGED
@@ -4,4 +4,7 @@
|
|
4 |
<option name="sdkName" value="Python 3.9 (CompUGE)" />
|
5 |
</component>
|
6 |
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (CompUGE)" project-jdk-type="Python SDK" />
|
|
|
|
|
|
|
7 |
</project>
|
|
|
4 |
<option name="sdkName" value="Python 3.9 (CompUGE)" />
|
5 |
</component>
|
6 |
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (CompUGE)" project-jdk-type="Python SDK" />
|
7 |
+
<component name="PythonCompatibilityInspectionAdvertiser">
|
8 |
+
<option name="version" value="3" />
|
9 |
+
</component>
|
10 |
</project>
|
.idea/workspace.xml
CHANGED
@@ -5,7 +5,24 @@
|
|
5 |
</component>
|
6 |
<component name="ChangeListManager">
|
7 |
<list default="true" id="ec41c3d8-2441-4e70-b178-d069f99160a8" name="Changes" comment="">
|
8 |
-
<change
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
</list>
|
10 |
<option name="SHOW_DIALOG" value="false" />
|
11 |
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
@@ -40,8 +57,11 @@
|
|
40 |
"keyToString": {
|
41 |
"ASKED_ADD_EXTERNAL_FILES": "true",
|
42 |
"ASKED_MARK_IGNORED_FILES_AS_EXCLUDED": "true",
|
|
|
|
|
43 |
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
44 |
"RunOnceActivity.ShowReadmeOnStart": "true",
|
|
|
45 |
"git-widget-placeholder": "main",
|
46 |
"last_opened_file_path": "/Users/ahmadshallouf/workspace/CompUGE",
|
47 |
"node.js.detected.package.eslint": "true",
|
@@ -49,9 +69,23 @@
|
|
49 |
"node.js.selected.package.eslint": "(autodetect)",
|
50 |
"node.js.selected.package.tslint": "(autodetect)",
|
51 |
"nodejs_package_manager_path": "npm",
|
|
|
52 |
"vue.rearranger.settings.migration": "true"
|
|
|
|
|
|
|
|
|
|
|
|
|
53 |
}
|
54 |
}]]></component>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
<component name="SharedIndexes">
|
56 |
<attachedChunks>
|
57 |
<set>
|
@@ -73,7 +107,13 @@
|
|
73 |
<workItem from="1711100405638" duration="146000" />
|
74 |
<workItem from="1711103656370" duration="1154000" />
|
75 |
<workItem from="1711206232573" duration="11331000" />
|
76 |
-
<workItem from="1711303910761" duration="
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
</task>
|
78 |
<servers />
|
79 |
</component>
|
@@ -87,4 +127,7 @@
|
|
87 |
<option featureType="dependencySupport" implementationName="javascript:npm:pug" />
|
88 |
<option featureType="dependencySupport" implementationName="executable:kubectl" />
|
89 |
</component>
|
|
|
|
|
|
|
90 |
</project>
|
|
|
5 |
</component>
|
6 |
<component name="ChangeListManager">
|
7 |
<list default="true" id="ec41c3d8-2441-4e70-b178-d069f99160a8" name="Changes" comment="">
|
8 |
+
<change afterPath="$PROJECT_DIR$/Backend/CQI_Leaderboard.csv" afterDir="false" />
|
9 |
+
<change afterPath="$PROJECT_DIR$/Backend/database_service.py" afterDir="false" />
|
10 |
+
<change afterPath="$PROJECT_DIR$/Backend/main.py" afterDir="false" />
|
11 |
+
<change afterPath="$PROJECT_DIR$/Backend/requirements.txt" afterDir="false" />
|
12 |
+
<change afterPath="$PROJECT_DIR$/Frontend/submission.py" afterDir="false" />
|
13 |
+
<change beforePath="$PROJECT_DIR$/.idea/copilot/chatSessions/00000000000.xd" beforeDir="false" />
|
14 |
+
<change beforePath="$PROJECT_DIR$/.idea/copilot/chatSessions/blobs/version" beforeDir="false" />
|
15 |
+
<change beforePath="$PROJECT_DIR$/.idea/copilot/chatSessions/xd.lck" beforeDir="false" />
|
16 |
+
<change beforePath="$PROJECT_DIR$/.idea/dataSources.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/dataSources.xml" afterDir="false" />
|
17 |
+
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
|
18 |
+
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
19 |
+
<change beforePath="$PROJECT_DIR$/CQI_Leaderboard.csv" beforeDir="false" />
|
20 |
+
<change beforePath="$PROJECT_DIR$/app.py" beforeDir="false" afterPath="$PROJECT_DIR$/app.py" afterDir="false" />
|
21 |
+
<change beforePath="$PROJECT_DIR$/database_service.py" beforeDir="false" afterPath="$PROJECT_DIR$/Backend/Dockerfile" afterDir="false" />
|
22 |
+
<change beforePath="$PROJECT_DIR$/docker-compose.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/Backend/docker-compose.yaml" afterDir="false" />
|
23 |
+
<change beforePath="$PROJECT_DIR$/leaderboard.py" beforeDir="false" afterPath="$PROJECT_DIR$/Frontend/leaderboard.py" afterDir="false" />
|
24 |
+
<change beforePath="$PROJECT_DIR$/requirements.txt" beforeDir="false" afterPath="$PROJECT_DIR$/requirements.txt" afterDir="false" />
|
25 |
+
<change beforePath="$PROJECT_DIR$/submission.py" beforeDir="false" />
|
26 |
</list>
|
27 |
<option name="SHOW_DIALOG" value="false" />
|
28 |
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
|
57 |
"keyToString": {
|
58 |
"ASKED_ADD_EXTERNAL_FILES": "true",
|
59 |
"ASKED_MARK_IGNORED_FILES_AS_EXCLUDED": "true",
|
60 |
+
"ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
61 |
+
"Python.database_service.executor": "Run",
|
62 |
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
63 |
"RunOnceActivity.ShowReadmeOnStart": "true",
|
64 |
+
"SHARE_PROJECT_CONFIGURATION_FILES": "true",
|
65 |
"git-widget-placeholder": "main",
|
66 |
"last_opened_file_path": "/Users/ahmadshallouf/workspace/CompUGE",
|
67 |
"node.js.detected.package.eslint": "true",
|
|
|
69 |
"node.js.selected.package.eslint": "(autodetect)",
|
70 |
"node.js.selected.package.tslint": "(autodetect)",
|
71 |
"nodejs_package_manager_path": "npm",
|
72 |
+
"settings.editor.selected.configurable": "preferences.lookFeel",
|
73 |
"vue.rearranger.settings.migration": "true"
|
74 |
+
},
|
75 |
+
"keyToStringList": {
|
76 |
+
"DatabaseDriversLRU": [
|
77 |
+
"mongo",
|
78 |
+
"postgresql"
|
79 |
+
]
|
80 |
}
|
81 |
}]]></component>
|
82 |
+
<component name="RecentsManager">
|
83 |
+
<key name="MoveFile.RECENT_KEYS">
|
84 |
+
<recent name="$PROJECT_DIR$/Backend" />
|
85 |
+
<recent name="$PROJECT_DIR$/Frontend" />
|
86 |
+
<recent name="$PROJECT_DIR$/Database" />
|
87 |
+
</key>
|
88 |
+
</component>
|
89 |
<component name="SharedIndexes">
|
90 |
<attachedChunks>
|
91 |
<set>
|
|
|
107 |
<workItem from="1711100405638" duration="146000" />
|
108 |
<workItem from="1711103656370" duration="1154000" />
|
109 |
<workItem from="1711206232573" duration="11331000" />
|
110 |
+
<workItem from="1711303910761" duration="3241000" />
|
111 |
+
<workItem from="1711472419446" duration="783000" />
|
112 |
+
<workItem from="1711542646310" duration="15000" />
|
113 |
+
<workItem from="1711707582118" duration="6049000" />
|
114 |
+
<workItem from="1711714487006" duration="12234000" />
|
115 |
+
<workItem from="1712172588052" duration="1722000" />
|
116 |
+
<workItem from="1712174420067" duration="1637000" />
|
117 |
</task>
|
118 |
<servers />
|
119 |
</component>
|
|
|
127 |
<option featureType="dependencySupport" implementationName="javascript:npm:pug" />
|
128 |
<option featureType="dependencySupport" implementationName="executable:kubectl" />
|
129 |
</component>
|
130 |
+
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
131 |
+
<SUITE FILE_PATH="coverage/CompUGE$database_service.coverage" NAME="database_service Coverage Results" MODIFIED="1711802806809" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
132 |
+
</component>
|
133 |
</project>
|
Backend/CQI_Leaderboard.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
Model,Size,Accuracy,Precision,Recall,F1 Score,Overall Score
|
2 |
+
Dummy,1000000,59,54,52,50,50
|
3 |
+
Dummy2,20000000,95,79,78,81,81
|
Backend/Dockerfile
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Dockerfile for Fastapi service in main.py
|
2 |
+
|
3 |
+
FROM python:3.9-slim
|
4 |
+
|
5 |
+
# Set the working directory in the container
|
6 |
+
WORKDIR /app
|
7 |
+
COPY . /app
|
8 |
+
|
9 |
+
# Install dependencies
|
10 |
+
RUN pip install --upgrade pip
|
11 |
+
RUN pip install -r requirements.txt
|
12 |
+
|
13 |
+
# Expose the port the app runs on
|
14 |
+
ENTRYPOINT sh -c "uvicorn main:app --host=0.0.0.0 --port=8000 --reload"
|
Backend/database_service.py
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
'''
|
2 |
+
Use sqlalchemy to connect to the database and perform CRUD operations
|
3 |
+
POSTGRES_USER=CompUGE
|
4 |
+
POSTGRES_PASSWORD=6pbRWypqQ2jEnwt996b0WPEnbbdRiFap
|
5 |
+
'''
|
6 |
+
|
7 |
+
from sqlalchemy import create_engine
|
8 |
+
from sqlalchemy.orm import sessionmaker
|
9 |
+
from sqlalchemy.ext.declarative import declarative_base
|
10 |
+
from sqlalchemy import Column, Integer, String, Float
|
11 |
+
from sqlalchemy.exc import IntegrityError
|
12 |
+
import pandas as pd
|
13 |
+
import os
|
14 |
+
|
15 |
+
# Database URL
|
16 |
+
POSTGRES_USER = 'CompUGE'
|
17 |
+
POSTGRES_PASSWORD = '6pbRWypqQ2jEnwt996b0WPEnbbdRiFap'
|
18 |
+
POSTGRES_HOST = 'db'
|
19 |
+
POSTGRES_PORT = '5432'
|
20 |
+
POSTGRES_DB = 'postgres'
|
21 |
+
DATABASE_URL = f'postgresql://{POSTGRES_USER}:{POSTGRES_PASSWORD}@{POSTGRES_HOST}:{POSTGRES_PORT}/{POSTGRES_DB}'
|
22 |
+
|
23 |
+
# Create an engine
|
24 |
+
engine = create_engine(DATABASE_URL)
|
25 |
+
Session = sessionmaker(bind=engine)
|
26 |
+
session = Session()
|
27 |
+
Base = declarative_base()
|
28 |
+
|
29 |
+
|
30 |
+
# Define the schema
|
31 |
+
# Model,Accuracy,Precision,Recall,F1 Score,Evaluation Time,Overall Score
|
32 |
+
class Leaderboard(Base):
|
33 |
+
__tablename__ = 'leaderboard'
|
34 |
+
task = Column(String, primary_key=True)
|
35 |
+
model = Column(String, primary_key=True)
|
36 |
+
size = Column(Float)
|
37 |
+
accuracy = Column(Float)
|
38 |
+
precision = Column(Float)
|
39 |
+
recall = Column(Float)
|
40 |
+
f1_score = Column(Float)
|
41 |
+
overall_score = Column(Float)
|
42 |
+
|
43 |
+
def __repr__(self):
|
44 |
+
return f"<Leaderboard(task='{self.task}', model='{self.model}', accuracy='{self.accuracy}', precision='{self.precision}', recall='{self.recall}', f1_score='{self.f1_score}', evaluation_time='{self.evaluation_time}', overall_score='{self.overall_score}')>"
|
45 |
+
|
46 |
+
def __str__(self):
|
47 |
+
return f"<Leaderboard(task='{self.task}', model='{self.model}', accuracy='{self.accuracy}', precision='{self.precision}', recall='{self.recall}', f1_score='{self.f1_score}', evaluation_time='{self.evaluation_time}', overall_score='{self.overall_score}')>"
|
48 |
+
|
49 |
+
|
50 |
+
# Insert data from a dataframe
|
51 |
+
def insert_data_from_dataframe(df, task):
|
52 |
+
for index, row in df.iterrows():
|
53 |
+
try:
|
54 |
+
session.add(
|
55 |
+
Leaderboard(task=task, model=row['Model'], size=row['Size'], accuracy=row['Accuracy'], precision=row['Precision'],
|
56 |
+
recall=row['Recall'], f1_score=row['F1 Score'],
|
57 |
+
overall_score=row['Overall Score']))
|
58 |
+
session.commit()
|
59 |
+
except IntegrityError as e:
|
60 |
+
print(f"Error: {e}")
|
61 |
+
session.rollback()
|
62 |
+
print("Data inserted successfully!")
|
63 |
+
|
64 |
+
|
65 |
+
# Insert data from a dictionary
|
66 |
+
def insert_data_from_dict(data):
|
67 |
+
try:
|
68 |
+
session.add(
|
69 |
+
Leaderboard(task=data['task'], model=data['model'], accuracy=data['accuracy'], precision=data['precision'],
|
70 |
+
recall=data['recall'], f1_score=data['f1_score'], size=data['size'],
|
71 |
+
overall_score=data['overall_score']))
|
72 |
+
session.commit()
|
73 |
+
except IntegrityError as e:
|
74 |
+
print(f"Error: {e}")
|
75 |
+
session.rollback()
|
76 |
+
print("Data inserted successfully!")
|
77 |
+
|
78 |
+
|
79 |
+
# Query data by task
|
80 |
+
def query_data_by_task(task):
|
81 |
+
return session.query(Leaderboard).filter(Leaderboard.task == task).all()
|
82 |
+
|
83 |
+
|
84 |
+
# Query data by model
|
85 |
+
def query_data_by_model(model):
|
86 |
+
return session.query(Leaderboard).filter(Leaderboard.model == model).all()
|
87 |
+
|
88 |
+
|
89 |
+
# Query data by task return as dataframe
|
90 |
+
def query_data_by_task_as_dataframe(task):
|
91 |
+
return pd.read_sql(session.query(Leaderboard).filter(Leaderboard.task == task).statement, session.bind)
|
92 |
+
|
93 |
+
|
94 |
+
# Query data by model return as dataframe
|
95 |
+
def query_data_by_model_as_dataframe(model):
|
96 |
+
return pd.read_sql(session.query(Leaderboard).filter(Leaderboard.model == model).statement, session.bind)
|
97 |
+
|
98 |
+
|
99 |
+
# Query data by task and model
|
100 |
+
def query_data_by_task_and_model(task, model):
|
101 |
+
return session.query(Leaderboard).filter(Leaderboard.task == task, Leaderboard.model == model).first()
|
102 |
+
|
103 |
+
|
104 |
+
# Query data by task and model return as dataframe
|
105 |
+
def query_data_by_task_and_model_as_dataframe(task, model):
|
106 |
+
return pd.read_sql(session.query(Leaderboard).filter(Leaderboard.task == task, Leaderboard.model == model).statement,
|
107 |
+
session.bind)
|
108 |
+
|
109 |
+
|
110 |
+
# Update data by task and model
|
111 |
+
def update_data_by_task_and_model(task, model, data):
|
112 |
+
try:
|
113 |
+
session.query(Leaderboard).filter(Leaderboard.task == task, Leaderboard.model == model).update(data)
|
114 |
+
session.commit()
|
115 |
+
except IntegrityError as e:
|
116 |
+
print(f"Error: {e}")
|
117 |
+
session.rollback()
|
118 |
+
print("Data updated successfully!")
|
119 |
+
|
120 |
+
|
121 |
+
# Delete data by task and model
|
122 |
+
def delete_data_by_task_and_model(task, model):
|
123 |
+
try:
|
124 |
+
session.query(Leaderboard).filter(Leaderboard.task == task, Leaderboard.model == model).delete()
|
125 |
+
session.commit()
|
126 |
+
except IntegrityError as e:
|
127 |
+
print(f"Error: {e}")
|
128 |
+
session.rollback()
|
129 |
+
print("Data deleted successfully!")
|
130 |
+
|
131 |
+
|
132 |
+
# Create the table
|
133 |
+
Base.metadata.create_all(engine)
|
docker-compose.yaml β Backend/docker-compose.yaml
RENAMED
@@ -1,6 +1,14 @@
|
|
1 |
version: '3.0'
|
2 |
|
3 |
services:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
db:
|
5 |
image: postgres:latest
|
6 |
restart: always
|
@@ -8,9 +16,7 @@ services:
|
|
8 |
- POSTGRES_USER=CompUGE
|
9 |
- POSTGRES_PASSWORD=6pbRWypqQ2jEnwt996b0WPEnbbdRiFap
|
10 |
expose:
|
11 |
-
- '5432'
|
12 |
-
ports:
|
13 |
-
- '15564:5432'
|
14 |
volumes:
|
15 |
- db:/var/lib/postgresql/data
|
16 |
volumes:
|
|
|
1 |
version: '3.0'
|
2 |
|
3 |
services:
|
4 |
+
backend:
|
5 |
+
build: .
|
6 |
+
restart: always
|
7 |
+
environment:
|
8 |
+
- POSTGRES_USER=CompUGE
|
9 |
+
- POSTGRES_PASSWORD=6pbRWypqQ2jEnwt996b0WPEnbbdRiFap
|
10 |
+
ports:
|
11 |
+
- "15564:8000"
|
12 |
db:
|
13 |
image: postgres:latest
|
14 |
restart: always
|
|
|
16 |
- POSTGRES_USER=CompUGE
|
17 |
- POSTGRES_PASSWORD=6pbRWypqQ2jEnwt996b0WPEnbbdRiFap
|
18 |
expose:
|
19 |
+
- '15565:5432'
|
|
|
|
|
20 |
volumes:
|
21 |
- db:/var/lib/postgresql/data
|
22 |
volumes:
|
Backend/main.py
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import fastapi
|
2 |
+
import pandas as pd
|
3 |
+
|
4 |
+
import database_service
|
5 |
+
|
6 |
+
app = fastapi.FastAPI()
|
7 |
+
|
8 |
+
database_service.insert_data_from_dataframe(pd.read_csv("CQI_Leaderboard.csv"), "Question Identification")
|
9 |
+
|
10 |
+
|
11 |
+
@app.get("/api/health")
|
12 |
+
def health():
|
13 |
+
return {"status": "ok"}
|
14 |
+
|
15 |
+
|
16 |
+
@app.get("/api/")
|
17 |
+
def root():
|
18 |
+
return "Welcome to CompUGE API! This API is private and not intended for public use."
|
19 |
+
|
20 |
+
|
21 |
+
@app.get("/")
|
22 |
+
def root():
|
23 |
+
return "Welcome to CompUGE backend! Please visit /api/ for the API documentation."
|
24 |
+
|
25 |
+
|
26 |
+
@app.get("/api/leaderboard/QI")
|
27 |
+
def leaderboard():
|
28 |
+
return database_service.query_data_by_task_as_dataframe("Question Identification")
|
Backend/requirements.txt
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
fastapi
|
2 |
+
SQLAlchemy
|
3 |
+
cython
|
4 |
+
psycopg2-binary
|
5 |
+
uvicorn
|
6 |
+
pandas
|
7 |
+
numpy
|
CQI_Leaderboard.csv
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
Model,Accuracy,Precision,Recall,F1 Score,Evaluation Time,Overall Score
|
2 |
-
Dummy,51,59,54,52,50,50
|
3 |
-
Dummy2,52,60,55,53,51,51
|
|
|
|
|
|
|
|
leaderboard.py β Frontend/leaderboard.py
RENAMED
File without changes
|
Frontend/submission.py
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
# a method that recieves a list of lables and predictions and returns :
|
3 |
+
# 1. the accuracy of the model
|
4 |
+
# 2. the precision of the model
|
5 |
+
# 3. the recall of the model
|
6 |
+
# 4. the f1 score of the model
|
7 |
+
# 5. the overall score of the model
|
8 |
+
def evaluate_model(labels, predictions):
|
9 |
+
accuracy = accuracy_score(labels, predictions)
|
10 |
+
precision = precision_score(labels, predictions)
|
11 |
+
recall = recall_score(labels, predictions)
|
12 |
+
f1 = f1_score(labels, predictions)
|
13 |
+
overall = (accuracy + precision + recall + f1) / 4
|
14 |
+
return accuracy, precision, recall, f1, overall
|
15 |
+
|
16 |
+
|
17 |
+
# a method that calculates the accuracy of the model
|
18 |
+
def accuracy_score(labels, predictions):
|
19 |
+
return sum([1 for i in range(len(labels)) if labels[i] == predictions[i]]) / len(labels)
|
20 |
+
|
21 |
+
|
22 |
+
def precision_score(labels, predictions):
|
23 |
+
tp = sum([1 for i in range(len(labels)) if labels[i] == 1 and predictions[i] == 1])
|
24 |
+
fp = sum([1 for i in range(len(labels)) if labels[i] == 0 and predictions[i] == 1])
|
25 |
+
return tp / (tp + fp)
|
26 |
+
|
27 |
+
|
28 |
+
def recall_score(labels, predictions):
|
29 |
+
tp = sum([1 for i in range(len(labels)) if labels[i] == 1 and predictions[i] == 1])
|
30 |
+
fn = sum([1 for i in range(len(labels)) if labels[i] == 1 and predictions[i] == 0])
|
31 |
+
return tp / (tp + fn)
|
32 |
+
|
33 |
+
|
34 |
+
def f1_score(labels, predictions):
|
35 |
+
precision = precision_score(labels, predictions)
|
36 |
+
recall = recall_score(labels, predictions)
|
37 |
+
return 2 * (precision * recall) / (precision + recall)
|
38 |
+
|
39 |
+
|
40 |
+
def overall_score(labels, predictions):
|
41 |
+
accuracy = accuracy_score(labels, predictions)
|
42 |
+
precision = precision_score(labels, predictions)
|
43 |
+
recall = recall_score(labels, predictions)
|
44 |
+
f1 = f1_score(labels, predictions)
|
45 |
+
acc_weight = 0.25
|
46 |
+
precision_weight = 0.25
|
47 |
+
recall_weight = 0.25
|
48 |
+
f1_weight = 0.25
|
49 |
+
return (accuracy * acc_weight) + (precision * precision_weight) + (recall * recall_weight) + (f1 * f1_weight)
|
50 |
+
|
__pycache__/app.cpython-39.pyc
CHANGED
Binary files a/__pycache__/app.cpython-39.pyc and b/__pycache__/app.cpython-39.pyc differ
|
|
app.py
CHANGED
@@ -1,6 +1,8 @@
|
|
1 |
import gradio as gr
|
2 |
import pandas as pd
|
3 |
-
import
|
|
|
|
|
4 |
|
5 |
# UI Root
|
6 |
with gr.Blocks() as demo:
|
@@ -13,10 +15,9 @@ with gr.Blocks() as demo:
|
|
13 |
# QC Tab
|
14 |
with gr.Tab("Question Classification"):
|
15 |
gr.Markdown("### Question Classification Leaderboard")
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
cqi_leaderboard = gr.components.Dataframe(CQI_Leaderboard)
|
20 |
|
21 |
# OAI Tab
|
22 |
with gr.Tab("Object and Aspect Identification"):
|
@@ -48,4 +49,4 @@ with gr.Blocks() as demo:
|
|
48 |
gr.Markdown("### Contact")
|
49 |
gr.Markdown("For any questions, please contact us at ahmad.shallouf@uni-hamburg.de")
|
50 |
# Launch public demo
|
51 |
-
demo.launch(
|
|
|
1 |
import gradio as gr
|
2 |
import pandas as pd
|
3 |
+
import requests
|
4 |
+
|
5 |
+
backend_url = "http://localhost:15564/api"
|
6 |
|
7 |
# UI Root
|
8 |
with gr.Blocks() as demo:
|
|
|
15 |
# QC Tab
|
16 |
with gr.Tab("Question Classification"):
|
17 |
gr.Markdown("### Question Classification Leaderboard")
|
18 |
+
cqi_leaderboard = pd.DataFrame(requests.get(backend_url + "/leaderboard/QI").json())
|
19 |
+
cqi_leaderboard.drop(columns=["task"], inplace=True)
|
20 |
+
cqi_leaderboard_component = gr.components.Dataframe(cqi_leaderboard)
|
|
|
21 |
|
22 |
# OAI Tab
|
23 |
with gr.Tab("Object and Aspect Identification"):
|
|
|
49 |
gr.Markdown("### Contact")
|
50 |
gr.Markdown("For any questions, please contact us at ahmad.shallouf@uni-hamburg.de")
|
51 |
# Launch public demo
|
52 |
+
demo.launch()
|
database_service.py
DELETED
File without changes
|
requirements.txt
CHANGED
@@ -1 +1,6 @@
|
|
1 |
-
gradio
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
gradio~=4.21.0
|
2 |
+
SQLAlchemy~=2.0.29
|
3 |
+
cython
|
4 |
+
psycopg2
|
5 |
+
pandas~=2.2.1
|
6 |
+
requests
|
submission.py
DELETED
File without changes
|