rebeccajohnson88 / h2a_oversight Goto Github PK
View Code? Open in Web Editor NEWPrivate repo for in-progress work on H-2A legal oversight paper
Private repo for in-progress work on H-2A legal oversight paper
Start of script here (may want to move out of notebook form for language translation part): https://github.com/rebeccajohnson88/h2a_oversight_paper/blob/main/code/20a_combine_clean_addendums.ipynb
General notes: based on your qss20 code with following changes: (1) keep unit of analysis at section level rather than concatenating to single job description- we can concatenate letter but we may want to keep separate; (2) rather than detect spanish based on keyword, shifts to language model-based detection
Next steps (feel free to skip over the section name/numbering cleaning updates for now):
sample_add = addendum.sample(n = 200, random_state = 91988)
## example true positive in spanish:
## CASE_NUMBER: H-300-20063-372516
## test language detection code on a couple examples
examples = sample_add.loc[sample_add.CASE_NUMBER.isin(["H-300-20063-372516",
"H-300-19316-139384"])].copy()
examples
### for eunice, not sure if robust enough
### to deal with multiple languages in same part
### of text so might want to generalize
def detect_onestr(one_str):
## return list
res = detect_langs(one_str)
## transform into a string and split on :
split_res = str(res[0]).split(":")
## return split
return(split_res)
## add language and probabilities to dataframe
examples['lang'] = [detect_onestr(one_str)[0] for one_str in examples.SECTION_DETAILS]
examples['lang_prob'] = [detect_onestr(one_str)[1] for one_str in examples.SECTION_DETAILS]
Focal script: can keep as same script number and just make direct edits - https://github.com/rebeccajohnson88/h2a_oversight_paper/blob/main/code/03_fuzzy_matching.R
here
library, the R project, and relative paths to avoid hardcoding the pathname. Point the pathname for DATA_DIR
to the new Dropbox folder (can access via here if you clone the repo within dropbox and use relative paths). So it'll look something like ../../h2a_all_data/something
approved_only <- h2a %>%
filter(status_cleaned == "- CERTIFICATION" | status_cleaned == "- PARTIAL CERTIFICATION") %>%
filter(EMPLOYER_NAME != "") %>%
mutate(state_formatch = ifelse(EMPLOYER_STATE == "",
WORKSITE_STATE, EMPLOYER_STATE))
investigations_filtered <- investigations %>%
filter((`Registration Act` == "H2A" | `Registration Act` == "FLSA" | `Registration Act` == "MSPA") &
(str_detect(naic_cd, "^11") | naic_cd %in% h2a_NAICS$NAICS_CODE))
naic_cd
, status_cleaned
, and Registration Act
(might want to rename cols in compliance action data to lowercase/no spaces)A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.