This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(gganimate) | |
# Parameters | |
h <- 0.02 # Time cost per worker for the solver | |
r <- 2 # Rental rate for one unit of compute | |
worker_grid <- seq(0.2, 0.8, by = 0.1) # Range of human worker knowledge | |
solver_grid <- seq(0.3, 1.0, by = 0.1) # Range of human solver knowledge | |
zAI_values <- seq(0.25, 0.95, by = 0.05) # Range of AI knowledge levels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This R script generates synthetic data representing job functions in various languages, translates them to English using a local language model, and detects the original language. The output includes the original job function, the translated job function, and the detected language, and is saved to a CSV file for further use. | |
# Load necessary libraries | |
library(httr) | |
library(jsonlite) | |
library(textcat) | |
library(tidyverse) | |
library(glue) | |
library(here) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load necessary libraries | |
library(janitor) | |
library(httr) | |
library(jsonlite) | |
library(tidyverse) | |
library(furrr) | |
library(stringr) | |
library(glue) | |
# Setup parallel processing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Instructions: | |
# - Download LM Studio | |
# - Download Phi-3 Model (within LM Studio) | |
# - Load the model into LM Studio | |
# - Start the Local Server (instructions here: https://lmstudio.ai/docs/local-server) | |
# Load necessary libraries | |
library(httr) | |
library(jsonlite) | |
library(tidyverse) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
def pep_talk (): | |
pep_csv = pd.read_csv( | |
"https://raw.githubusercontent.com/farach/pep/main/pep_talk.csv", | |
encoding = 'unicode_escape' | |
) | |
pepText = list( | |
map( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pep_talk <- function() { | |
read.csv("https://raw.githubusercontent.com/farach/pep/main/pep_talk.csv") |> | |
purrr::map_chr(~ sample(.x, 1)) |> | |
glue::glue_collapse(sep = " ") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(fredr) | |
library(tidyverse) | |
library(geofacet) | |
library(ggrepel) | |
library(ggtext) | |
set.seed(42) # For reproducibility | |
# Prepare state series IDs | |
state_ids <- c( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "Using SpacyR on scraped glassdoor reviews" | |
author: "Alex Farach" | |
date: "10/17/2021" | |
output: html_document | |
--- | |
```{r setup, include=FALSE} | |
library(knitr) | |
knitr::opts_chunk$set( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(spotifyr) | |
library(tidyverse) | |
library(lubridate) | |
library(glue) | |
library(geniusr) | |
library(rvest) | |
library(tidytext) | |
# Create a ggplot2 theme | |
theme_alex <- function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(tidytext) | |
library(vader) | |
library(glue) | |
theme_alex <- function() { | |
font <- "Arial" | |
theme_minimal() | |
theme( | |
strip.text = element_text( |
NewerOlder