dwb2023 commited on
Commit
aafdc15
·
1 Parent(s): 2f52407

undo experiment

Browse files
Files changed (1) hide show
  1. data_access.py +3 -10
data_access.py CHANGED
@@ -19,16 +19,9 @@ 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
- # """)
28
-
29
  con.execute("""
30
  CREATE VIEW negative_tone AS (
31
- SELECT GKGRECORDID, SourceCollectionIdentifier, DATE, SourceCommonName, DocumentIdentifier, "V2.1Quotations", tone, V1Counts, "V2.1Counts", "V2.1Amounts", V1Themes, V2EnhancedThemes, V1Locations, V2EnhancedLocations, V1Persons, V2EnhancedPersons, V1Organizations, V2EnhancedOrganizations, "V2.1AllNames"
32
  FROM read_parquet('hf://datasets/dwb2023/gdelt-gkg-march2020-v2@~parquet/default/negative_tone/*.parquet')
33
  );
34
  """)
@@ -44,7 +37,7 @@ def get_gdelt_data(
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
  ]
@@ -120,6 +113,6 @@ GDELT_CATEGORIES = {
120
  "Names": ["V2.1AllNames"],
121
  "Counts": ["V2.1Counts", "V1Counts"],
122
  "Amounts": ["V2.1Amounts"],
123
- #"V2GCAM": ["V2GCAM"],
124
  "V2.1EnhancedDates": ["V2.1EnhancedDates"],
125
  }
 
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
  "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
  ]
 
113
  "Names": ["V2.1AllNames"],
114
  "Counts": ["V2.1Counts", "V1Counts"],
115
  "Amounts": ["V2.1Amounts"],
116
+ "V2GCAM": ["V2GCAM"],
117
  "V2.1EnhancedDates": ["V2.1EnhancedDates"],
118
  }