Skip to content

Commit

Permalink
Merge pull request #9 from argrecsys/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ansegura7 authored Nov 27, 2023
2 parents b95b623 + a0608b5 commit 42d3d5b
Show file tree
Hide file tree
Showing 146 changed files with 10,491 additions and 1,134 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Digital Government - DM Visual Analytics with ChatGPT
![version](https://img.shields.io/badge/version-0.2.0-blue)
![last-update](https://img.shields.io/badge/last_update-11/25/2023-orange)
![version](https://img.shields.io/badge/version-0.3.0-blue)
![last-update](https://img.shields.io/badge/last_update-11/27/2023-orange)
![license](https://img.shields.io/badge/license-Apache_2.0-brightgreen)

## Dependencies
Expand Down
9 changes: 6 additions & 3 deletions code/etls/generate_argument_data.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# -*- coding: utf-8 -*-
"""
Created by: Andrés Segura-Tinoco
Version: 0.2
Version: 0.3
Created on: Nov 23, 2023
Updated on: Nov 24, 2023
Updated on: Nov 27, 2023
Description: Generate argument data.
"""

import util_libs as ul
import datetime

MAX_TEXT_SIZE = 200

Expand Down Expand Up @@ -67,7 +68,7 @@ def create_argument_data(proposal_id: int, arg_data: dict, comments: dict):
arg_item["children"].append(comment_item)
else:
print(
f"- Comment id icorrect: {comment_id} for proposal: {proposal_id}"
f"- Incorrect comment id: {comment_id} for proposal: {proposal_id}"
)

arg_cat_item["children"].append(arg_item)
Expand Down Expand Up @@ -169,6 +170,8 @@ def main():
### START PROGRAM ###
#####################
if __name__ == "__main__":
now = datetime.datetime.now()
print(f">> Run generate argument data ETL- {now}")
main()
#####################
#### END PROGRAM ####
Expand Down
7 changes: 5 additions & 2 deletions code/etls/generate_network_data.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# -*- coding: utf-8 -*-
"""
Created by: Andrés Segura-Tinoco
Version: 0.2
Version: 0.3
Created on: Nov 24, 2023
Updated on: Nov 24, 2023
Updated on: Nov 27, 2023
Description: Generate network data.
"""

import util_libs as ul
import datetime


def create_argument_data(proposal_id: int, arg_data: dict):
Expand Down Expand Up @@ -103,6 +104,8 @@ def main():
### START PROGRAM ###
#####################
if __name__ == "__main__":
now = datetime.datetime.now()
print(f">> Run generate network data ETL- {now}")
main()
#####################
#### END PROGRAM ####
Expand Down
7 changes: 5 additions & 2 deletions code/etls/generate_proposal_data.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# -*- coding: utf-8 -*-
"""
Created by: Andrés Segura-Tinoco
Version: 0.2
Version: 0.3
Created on: Nov 23, 2023
Updated on: Nov 24, 2023
Updated on: Nov 27, 2023
Description: Generate proposal data.
"""

import util_libs as ul
import datetime

MAX_TEXT_SIZE = 200

Expand Down Expand Up @@ -140,6 +141,8 @@ def main():
### START PROGRAM ###
#####################
if __name__ == "__main__":
now = datetime.datetime.now()
print(f">> Run generate proposal data ETL- {now}")
main()
#####################
#### END PROGRAM ####
Expand Down
11 changes: 7 additions & 4 deletions code/etls/generate_word_cloud.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# -*- coding: utf-8 -*-
"""
Created by: Andrés Segura-Tinoco
Version: 0.1
Version: 0.3
Created on: Nov 21, 2023
Updated on: Nov 23, 2023
Description: Generate word cloud images.
Updated on: Nov 27, 2023
Description: Generate word cloud resources.
"""

import util_libs as ul
from wordcloud import WordCloud
import datetime
import spacy
from wordcloud import WordCloud

# Load the spaCy model for Spanish
nlp = spacy.load("es_core_news_lg")
Expand Down Expand Up @@ -70,6 +71,8 @@ def main():
### START PROGRAM ###
#####################
if __name__ == "__main__":
now = datetime.datetime.now()
print(f">> Run generate word cloud data ETL- {now}")
main()
#####################
#### END PROGRAM ####
Expand Down
4 changes: 2 additions & 2 deletions code/etls/run_program.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
"""
Created by: Andrés Segura-Tinoco
Version: 0.2
Version: 0.3
Created on: Nov 24, 2023
Updated on: Nov 24, 2023
Updated on: Nov 27, 2023
Description: Run all ETL processes.
"""

Expand Down
8 changes: 7 additions & 1 deletion code/website/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ footer {
h3 {
/** Page subtitle **/
margin-top: 20px;
margin-bottom: 0px;
margin-bottom: 5px;
font-family: 'Montserrat', Arial, sans-serif;
color: #003366;
}
Expand All @@ -40,4 +40,10 @@ img {
.chart {
width: 100%;
border-width: 0px;
}


#tb-data.dataTable {
font-size: 12px;
width: 100%;
}
5 changes: 3 additions & 2 deletions code/website/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@
<body>
<header>
<h1>Digital Government - DM Visual Analytics with ChatGPT</h1>
<h2>Proposal 152: "Instalación de placas solares en tejados"</h2>
</header>

<main>
<div class="container">
<!-- Word cloud -->
<h3>Analysis of Decide Madrid Proposal 152</h3>
<h3>Proposal word cloud</h3>
<div style="text-align: center;"><img src="../../result/images/152.png" alt="Proposal word cloud"></div>

<!-- Network chart -->
Expand All @@ -54,7 +55,7 @@ <h3>Display a DM debate in the form of a indented tree</h3>
<!-- ChatGPT extracted arguments table -->
<h3>ChatGPT Extracted Arguments</h3>
<div style="width: 100%; padding-top: 10px;">
<table id="tb-data" class="display" width="100%"></table>
<table id="tb-data" class="display"></table>
<div class="divSubTitle">Table 1 - ChatGPT extracted arguments.</div>
</div>
</div>
Expand Down
Binary file modified result/images/10195.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/10675.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/10687.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/1085.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/109.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/10996.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/11134.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/1114.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/1121.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/12131.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/1266.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/1284.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/1419.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/152.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/15711.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/15970.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/15978.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/15996.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/1824.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/1863.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/19024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/19170.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/1918.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/1937.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified result/images/19853.png
Binary file modified result/images/19914.png
Binary file modified result/images/20389.png
Binary file modified result/images/20657.png
Binary file modified result/images/21171.png
Binary file modified result/images/2121.png
Binary file modified result/images/2135.png
Binary file modified result/images/21567.png
Binary file modified result/images/22742.png
Binary file modified result/images/23131.png
Binary file modified result/images/23219.png
Binary file modified result/images/23704.png
Binary file modified result/images/2412.png
Binary file modified result/images/2445.png
Binary file modified result/images/24954.png
Binary file modified result/images/25077.png
Binary file modified result/images/2513.png
Binary file modified result/images/2524.png
Binary file modified result/images/2538.png
Binary file modified result/images/2551.png
Binary file modified result/images/2576.png
Binary file modified result/images/26277.png
Binary file modified result/images/26787.png
Binary file modified result/images/2944.png
Binary file modified result/images/3044.png
Binary file modified result/images/3078.png
Binary file modified result/images/3165.png
Binary file modified result/images/3481.png
Binary file modified result/images/3587.png
Binary file modified result/images/3905.png
Binary file modified result/images/417.png
Binary file modified result/images/4293.png
Binary file modified result/images/4541.png
Binary file modified result/images/494.png
Binary file modified result/images/50.png
Binary file modified result/images/507.png
Binary file modified result/images/61.png
Binary file modified result/images/615.png
Binary file modified result/images/629.png
Binary file modified result/images/6931.png
Binary file modified result/images/7.png
Binary file modified result/images/72.png
Binary file modified result/images/7382.png
Binary file modified result/images/7482.png
Binary file modified result/images/7488.png
Binary file modified result/images/7633.png
Binary file modified result/images/8188.png
Binary file modified result/images/8253.png
Binary file modified result/images/86.png
Binary file modified result/images/8640.png
Binary file modified result/images/878.png
Binary file modified result/images/879.png
Binary file modified result/images/89.png
Binary file modified result/images/900.png
Binary file modified result/images/965.png
9 changes: 8 additions & 1 deletion result/json_data/arguments/109.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,14 @@
"children": [
{
"name": "18",
"children": [],
"children": [
{
"name": "51873",
"value": 100,
"text": "[51873] Buenos d\u00edas a tod@s, la limpieza es una de las partes de una sociedad que tenemos que cuidar tod@s sin excepci\u00f3n, es tan importante como la seguridad de una ciudad o la sanidad para las personas, si tenemos insalubridad en una ciudad corremos mucho riesgo en todos los aspectos, os env\u00edo un enlace para que entr\u00e9is a leerlo si os parece correcto votarlo, los puntos a tratar sobre la limpieza son bastante interesantes, no hace falta hacer inversiones exageradas, es m\u00e1s, todo ello est\u00e1 sobradamente probado y funciona, votar la idea si os parece bien para conseguir el m\u00e1ximo posible de votos para poder reaccionar frente a la limpieza de Madrid.",
"short_text": "[51873] Buenos d\u00edas a tod@s, la limpieza es una de las partes de una sociedad que tenemos que cuidar tod@s sin excepci\u00f3n, es tan importante como la seguridad de una ciudad o la sanidad para las person..."
}
],
"text": "[SUPPORT] Algo que creo que beneficiar\u00eda ampliamente a la limpieza de la ciudad es el aumento de m\u00e1quinas limpiadoras de aceras.",
"short_text": "[SUPPORT] Algo que creo que beneficiar\u00eda ampliamente a la limpieza de la ciudad es el aumento de m\u00e1quinas limpiadoras de aceras."
},
Expand Down
13 changes: 10 additions & 3 deletions result/json_data/arguments/1121.json
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,14 @@
},
{
"name": "25",
"children": [],
"children": [
{
"name": "24256",
"value": 100,
"text": "[24256] Tambi\u00e9n est\u00e1 la propuesta en la secci\u00f3n debates: apoya un museo de metro.",
"short_text": "[24256] Tambi\u00e9n est\u00e1 la propuesta en la secci\u00f3n debates: apoya un museo de metro."
}
],
"text": "[ATTACK] Los vecinos de 4 caminos queremos parques, dotaciones, vida en la zona. La poblaci\u00f3n tiene que considerar esas cocheras un bien de patrimonio hist\u00f3rico.",
"short_text": "[ATTACK] Los vecinos de 4 caminos queremos parques, dotaciones, vida en la zona. La poblaci\u00f3n tiene que considerar esas cocheras un bien de patrimonio hist\u00f3rico."
},
Expand Down Expand Up @@ -562,8 +569,8 @@
"short_text": "[55070] Que los informes no son m\u00e1s que una mera excusa para justificar la venta de un terreno; Expropiaci\u00f3n forzosa; Nulidad del concurso\u2026 Todo lo que dices son acusaciones muy graves contra actuacio..."
}
],
"text": "[SUPPORT] Que los informes no son m\u00e1s que una mera excusa para justificar la venta de un terreno; Expropiaci\u00f3n forzosa; Nulidad del concurso\u0085 Todo lo que dices son acusaciones muy graves contra actuaciones de organismos p\u00fablicos.",
"short_text": "[SUPPORT] Que los informes no son m\u00e1s que una mera excusa para justificar la venta de un terreno; Expropiaci\u00f3n forzosa; Nulidad del concurso\u0085 Todo lo que dices son acusaciones muy graves contra actuac..."
"text": "[SUPPORT] Que los informes no son m\u00e1s que una mera excusa para justificar la venta de un terreno; Expropiaci\u00f3n forzosa; Nulidad del concurso\u2026 Todo lo que dices son acusaciones muy graves contra actuaciones de organismos p\u00fablicos.",
"short_text": "[SUPPORT] Que los informes no son m\u00e1s que una mera excusa para justificar la venta de un terreno; Expropiaci\u00f3n forzosa; Nulidad del concurso\u2026 Todo lo que dices son acusaciones muy graves contra actuac..."
},
{
"name": "36",
Expand Down
Loading

0 comments on commit 42d3d5b

Please sign in to comment.