dwb2023 commited on
Commit
f300d4f
·
1 Parent(s): ccfcc9c

validate changes

Browse files
Files changed (1) hide show
  1. data_access.py +9 -2
data_access.py CHANGED
@@ -19,9 +19,16 @@ def get_gdelt_data(
19
  con = duckdb.connect(database=':memory:')
20
 
21
  # Create view of the dataset
 
 
 
 
 
 
 
22
  con.execute("""
23
  CREATE VIEW negative_tone AS (
24
- SELECT *
25
  FROM read_parquet('hf://datasets/dwb2023/gdelt-gkg-march2020-v2@~parquet/default/negative_tone/*.parquet')
26
  );
27
  """)
@@ -37,7 +44,7 @@ def get_gdelt_data(
37
  "V1Locations IS NOT NULL",
38
  "V1Persons IS NOT NULL",
39
  "V1Organizations IS NOT NULL",
40
- "V2GCAM IS NOT NULL",
41
  "\"V2.1Quotations\" IS NOT NULL",
42
  "tone <= ?"
43
  ]
 
19
  con = duckdb.connect(database=':memory:')
20
 
21
  # Create view of the dataset
22
+ # con.execute("""
23
+ # CREATE VIEW negative_tone AS (
24
+ # SELECT *
25
+ # FROM read_parquet('hf://datasets/dwb2023/gdelt-gkg-march2020-v2@~parquet/default/negative_tone/*.parquet')
26
+ # );
27
+ # """)
28
+
29
  con.execute("""
30
  CREATE VIEW negative_tone AS (
31
+ SELECT GKRECORDID, DATE, SourceCommonName, DocumentIdentifier, "V2.1Quotations", tone, V1Counts, "V2.1Counts", "V2.1Amounts", V1Themes, V2EnhancedThemes, V1Locations, V2EnhancedLocations, V1Persons, V2EnhancedPersons, V1Organizations, V2EnhancedOrganizations
32
  FROM read_parquet('hf://datasets/dwb2023/gdelt-gkg-march2020-v2@~parquet/default/negative_tone/*.parquet')
33
  );
34
  """)
 
44
  "V1Locations IS NOT NULL",
45
  "V1Persons IS NOT NULL",
46
  "V1Organizations IS NOT NULL",
47
+ #"V2GCAM IS NOT NULL",
48
  "\"V2.1Quotations\" IS NOT NULL",
49
  "tone <= ?"
50
  ]