iangow / se_features

Linguistic features derived from StreetEvents
1 stars 3 forks source link

Check variable types on NER #27

Closed iangow closed 4 years ago

iangow commented 4 years ago

https://github.com/iangow/se_features/blob/cb85cabf454d06528ba51d572fea03e595722693/ner/alter_types.sql#L1 https://github.com/iangow/se_features/blob/cb85cabf454d06528ba51d572fea03e595722693/ner/alter_types.sql#L2

Are these integer in the current table? If so, I guess this happened automatically and this issue can be closed.

Yvonne-Han commented 4 years ago

Yes, I think so. I've checked - speaker_number in both tables are integers so I'm closing this issue.

library(dplyr, warn.conflicts = FALSE)
library(DBI)
library(reprex)

pg <- dbConnect(RPostgres::Postgres())
rs <- dbExecute(pg, "SET search_path TO se_features")

ner_class_alt_4 <- tbl(pg, "ner_class_alt_4")
ner_class_alt_7 <- tbl(pg, "ner_class_alt_7")

ner_class_alt_4
#> # Source:   table<ner_class_alt_4> [?? x 6]
#> # Database: postgres [yanzih1@10.101.13.99:5432/crsp]
#>    file_name last_update         speaker_number section context ner_tags   
#>    <chr>     <dttm>                       <int>   <int> <chr>   <chr>      
#>  1 3668737_T 2011-01-14 04:57:11              5       1 pres    {}         
#>  2 3668737_T 2011-01-14 04:57:11              4       1 pres    "{\"PERSON…
#>  3 3668737_T 2011-01-14 04:57:11              3       1 pres    "{\"MISC\"…
#>  4 3668737_T 2011-01-14 04:57:11              2       1 pres    "{\"PERSON…
#>  5 3668737_T 2011-01-14 04:57:11              1       1 pres    "{\"PERSON…
#>  6 2516454_T 2009-10-26 22:49:41             39       1 qa      {}         
#>  7 2516454_T 2009-10-26 22:49:41             38       1 qa      {}         
#>  8 2516454_T 2009-10-26 22:49:41             37       1 qa      {}         
#>  9 2516454_T 2009-10-26 22:49:41             36       1 qa      "{\"PERSON…
#> 10 2516454_T 2009-10-26 22:49:41             35       1 qa      "{\"PERSON…
#> # … with more rows
ner_class_alt_7
#> # Source:   table<ner_class_alt_7> [?? x 6]
#> # Database: postgres [yanzih1@10.101.13.99:5432/crsp]
#>    file_name  last_update         speaker_number section context ner_tags  
#>    <chr>      <dttm>                       <int>   <int> <chr>   <chr>     
#>  1 5593751_T  2015-01-17 08:01:35              2       1 pres    "{\"DATE\…
#>  2 5593751_T  2015-01-17 08:01:35              1       1 pres    "{\"PERSO…
#>  3 12235727_T 2019-01-15 03:59:30             41       1 qa      {}        
#>  4 12235727_T 2019-01-15 03:59:30             40       1 qa      {}        
#>  5 12235727_T 2019-01-15 03:59:30             39       1 qa      {}        
#>  6 12235727_T 2019-01-15 03:59:30             38       1 qa      {}        
#>  7 12235727_T 2019-01-15 03:59:30             37       1 qa      "{\"PERSO…
#>  8 12235727_T 2019-01-15 03:59:30             36       1 qa      {}        
#>  9 12235727_T 2019-01-15 03:59:30             35       1 qa      {}        
#> 10 12235727_T 2019-01-15 03:59:30             34       1 qa      "{\"ORGAN…
#> # … with more rows

Created on 2020-05-14 by the reprex package (v0.3.0)

iangow commented 4 years ago

@Yvonne-Han Thanks.