10.1 Lecture slides
10.2 Introduction
The goal of today’s assignment is to help you to understand both the potential and the limits of generative LLMs as tools for social science research. Rather than using large language models to improve performance on tasks that we have already attempted using other methods – such as classification, scaling, topic modelling, etc – we will instead use them to generate text that can be used for downstream applications.
Recent research has demonstrated that large language models can be used as proxies for human populations in social science research, at least to the extent that when one prompts the model to take on the persona of an individual with a given set of background characteristics, the model will respond to survey prompts in a way that closely mimics the distribution of responses from real people with those characteristics.
We will use a large language model (LLM) to simulate open-ended survey responses from fictional individuals with different demographic profiles. You will prompt the model to generate a paragraph in the first person, describing the individual’s political beliefs. You will then analyze the generated text using the methods you have learned in previous weeks on the course.
10.3 Packages
10.4 Gemini API
We will use Google’s Gemini model for this exercise.1 In order to use the Gemini API to make calls to the model, you will need to first register for access to the Gemini Developer API, which you can do by following this link (you will need a Google account). Once you have followed that link, you should see a screen like this:
1 Note that we could use essentially any LLM for this problem set. I have opted to use Gemini here because it is reasonably easy to generate the relevant API key, the Gemini class of models are competitive with other leading LLMs, and – crucially – it also comes with a generous free usage tier (with the downside that your data is used to improve the model).

Click “Get a Gemini API key”, then on the next screen click “Create API key” and follow the steps to generate your API key.
Once you have generated your API key, you will need to save it to the GOOGLE_API_KEY environment variable in your .Renviron file. For an easy way to find this file, use the following code:
You then need to edit the .Renviron so that it looks like this:

Then save the file and restart R.2
2 Note that if you struggle to find/edit the .Renviron file, do not despair. You can provide your api key directly to the chat_gemini() function we use below (e.g. via chat_gemini(api_key = "your_api_key")) but this is not usually considered best practice because it exposes your API key directly in your scripts, which can accidentally lead to it being shared publicly (e.g., if you push your code to GitHub). Storing your API key securely in the .Renviron file keeps it private and ensures your scripts remain safe for sharing and collaboration.
10.5 Prompting the model
We will begin by getting Gemini to generate synthetic responses about a hypothetical person’s political opinions. To do this, we will use a new R wrapper for the Gemini API, which is available via the ellmer package. This wrapper provides a convenient interface for sending prompts to the model and retrieving its responses.
Below is an example of how to construct and send a prompt. The goal is to simulate a paragraph written in the first person by a fictional individual with a specific demographic profile. The model is instructed to avoid describing the person’s background and instead focus on their political beliefs, values, and the issues they see as most important in the UK today.
In this code, there are three main steps:
- First, we define the prompt, the text that we want to use to send to the LLM
- Second, we define a chat object using the
chat_geminifunction. Here we are telling the API which version of gemini we wish to use. - Finally, we send the prompt to the API by using a
chat()function which is attached to ourmy_chatobject.
- Run the code below to generate a single example and inspect the response:
Reveal code
# Define the prompt to send to the model
prompt <- "Write a short paragraph in the first person,
explaining your political beliefs.
You are a 38-year-old man from the UK
with a highest qualification of postgraduate education.
You voted for Labour in the last election.
Do not describe yourself or your background --
focus only on your political beliefs.
In particular, describe the values that guide your
beliefs and the issues you think are most
important facing the country today."
# Set up a chat object for interacting with the model
my_chat <- chat_google_gemini(model = "gemini-2.5-flash-lite")
# Sent the prompt to the model using the chat() function
output <- my_chat$chat(prompt)My political beliefs are fundamentally rooted in a deep-seated conviction that
a decent society is one that actively strives for fairness and opportunity for
all its members. I believe in the power of collective action and robust public
services, funded equitably through taxation, to address societal challenges and
ensure that no one is left behind. This translates into a commitment to
strengthening our NHS, investing in quality education accessible to everyone,
and creating an economy that works for working people, not just those at the
top. I am particularly concerned about the escalating cost of living, which is
squeezing families and exacerbating existing inequalities, and the urgent need
for decisive action on climate change, which poses a fundamental threat to our
future. I believe in a progressive approach that prioritizes social justice,
environmental sustainability, and international cooperation as the cornerstones
of a thriving and secure nation.
The
ellmerchat()function retains the conversation’s context, which means that it will remember your previous interactions each time you use it for a new call. If instead we want thechat()function to forget previous interactions and start the conversation from scratch with each call to the LLM, we need to create a new chat object for each interaction.This is a bit annoying for our purposes, so instead we are going to create a function which will initialise a new chat object whenever we make a new call to Gemini.
Use this function to send our prompt from above to this function instead. Note that the text will not in general be exactly the same as this is a separate call to the LLM and therefore different text may be generated due to the probabilistic nature of the text-generation process.
Reveal code
For me, politics boils down to a few core principles: a deep-seated belief in
social justice and fairness, ensuring everyone has the opportunity to thrive,
not just survive. I value strong public services, built on solidarity and
compassion, as the bedrock of a decent society, alongside a commitment to
long-term economic and environmental sustainability. Looking at the country
today, the most pressing concerns are undoubtedly the pervasive cost of living
crisis and the resulting economic inequality, which is eroding living standards
for so many. Closely linked is the desperate need to rebuild our public
services, particularly the NHS, and tackle the climate crisis with genuine
urgency and ambition for our collective future.
- Adapt the
promptabove, changing some of the characteristics of the individual. You might make them a different age, or give them a different voting history, or something else. How does this affect the generated text?
Reveal code
# Define the prompt to send to the model
prompt <- "Write a short paragraph in the first person,
explaining your political beliefs.
You are a 22-year-old woman from the UK
with a highest qualification of GCSEs.
You voted for the Conservatives in the last election.
Do not describe yourself or your background --
focus only on your political beliefs.
In particular, describe the values that guide your
beliefs and the issues you think are most
important facing the country today."
# Generate output
output_2 <- run_interaction(prompt)My political beliefs are rooted in the idea of personal responsibility and the
importance of a strong, stable economy. I truly believe that if individuals are
empowered to work hard and keep more of what they earn, they can build better
lives for themselves and their families, which in turn strengthens the whole
country. This means controlling government spending and making sure we're not
burdening future generations with debt. The biggest issues for me right now are
definitely the cost of living and getting our economy back on track, alongside
ensuring our borders are secure and that law and order are upheld. We need
common sense solutions that deliver real results for ordinary people.
The LLM clearly seems to think that a 22-year old who voted Conservative and whose education only went to GCSE level would have quite different political beliefs to the 38-year old Labour voter from before. This makes sense, particularly given that past vote is likely to be strongly predictive of political attitudes.
10.6 Creating prompts programmatically
Rather than manually editing the prompt each time we want to generate a response for a different synthetic sample, a more efficient approach would be to define a function which constructs the appropriate prompt from a given set of inputs.
Create a function which takes four arguments:
age– the age of the hypothetical individualgender– the gender of the hypothetical individualeducation– the education of the hypothetical individualvote– the vote of the hypothetical individual
Use the
paste0()function to construct the prompt such that the arguments defined above are put in the correct place in the surrounding prompt text. Your function should return adata.framewhich includes the characteristics of the individual as well as the prompt you have created.
Reveal code
generate_prompt <- function(age, gender, education, vote){
prompt <- paste0(
"Write a short paragraph in the first person, explaining your political beliefs. ",
"You are a ", age, "-year-old ", gender, " from the UK",
", with a highest qualification of ", education,
". You voted for ", vote, " in the last election. ",
"Do not describe yourself or your background—focus only on your political beliefs. ",
"In particular, describe the values that guide your beliefs and the issues you think are most important facing the country today."
)
out <- data.frame(age, gender, education, vote, prompt)
return(out)
}- Use the function you just created to create a prompt for an individual with some characteristics of your choice.
Reveal code
[1] "Write a short paragraph in the first person, explaining your political beliefs. You are a 65-year-old male from the UK, with a highest qualification of degree. You voted for Reform in the last election. Do not describe yourself or your background—focus only on your political beliefs. In particular, describe the values that guide your beliefs and the issues you think are most important facing the country today."
- Send your newly constructed prompt to the Gemini API and inspect the response. Does it make sense?
Reveal code
My political beliefs are largely guided by a focus on individual responsibility
and the importance of a strong, stable economy. I truly believe that people
should have the freedom to make their own way and keep more of what they earn,
which is why I value careful government spending and sensible taxation. For me,
the most pressing issues facing the country today are tackling the cost of
living crisis head-on, ensuring there are genuine opportunities for everyone to
succeed through hard work, and maintaining effective law and order so that our
communities feel safe and secure.
Again, it looks like the LLM sees an individual with these characteristics as having distinct political beliefs.
10.7 Generating “silicon” samples
In the previous sections, we manually experimented with prompting an LLM to generate political statements from hypothetical individuals with different characteristics. While this approach works well for single examples, in real social science research we often require larger synthetic datasets to study patterns systematically. Questions 6, 7, and 8 guide you through a more systematic approach to creating these datasets.
- First define a set of demographic characteristics that you want to vary across your simulated respondents. Store each set of characteristics as a separate vector, whose elements include the relevant values of the hypothetical characteristics.
Reveal code
- Generate a synthetic dataset containing a set of individuals whose characteristics are sampled at random from the vectors that you defined above. That is, each individual in your data should have a random age, gender, education and past vote. Construct your data for no more than 50 individuals.
Reveal code
- Write a for-loop which a) generates a bespoke prompt for each of the synthetic individuals that you created in the questions above, b) sends that prompt to the gemini API, and c) saves the LLM-generated text in the
textvariable in the data.frame you created above. I’ve written some starter code for you below, but you will need to fill in the gaps.3
3 Note that there are rate limits on the Gemini API. For the Gemini 2.0 Flash-Lite model that we are using, there is currently a limit of 30 requests per minute and 1500 requests per day. In order to prevent us going over the requests per minute limit, I have included the Sys.sleep(2.2) command in the for-loop. This includes a 2.2 second pause in each iteration of the loop, ensuring that we don’t make more than 30 requests in any 60 second period.
Reveal code
i<-1
## Loop over rows of the silicon_sample data
for(i in 1:nrow(silicon_sample)){
# Pause so as to avoid making too many API requests
Sys.sleep(15)
# Generate prompt for the relevant row of the silicon_sample data
this_prompt <- generate_prompt(age = silicon_sample$age[i],
gender = silicon_sample$gender[i],
education = silicon_sample$education[i],
vote = silicon_sample$vote[i])
# Generate response from Gemini API
out <- run_interaction(this_prompt$prompt)
# Store the output
silicon_sample$text[i] <- out
}
# Save the output
save(silicon_sample, file = "../data/silicon_sample.Rdata") [1] "For me, political belief boils down to a fundamental sense of common sense and fairness for the people of this country. I believe we thrive when we prioritize our own citizens, ensuring there are sufficient resources, housing, and robust public services for everyone who has contributed here. The most pressing issues we face today are undoubtedly the unsustainable levels of immigration, which strain everything from our NHS to the housing market, and the relentless cost of living crisis that's crippling working families. We need a government that’s fiscally responsible, willing to cut wasteful spending and lower taxes, rather than pursuing costly, ideologically-driven policies like the current approach to net-zero, which only makes life harder and more expensive. Ultimately, I want to see a sovereign nation in full control of its borders and its future, with a strong sense of national pride and identity."
[2] "My political compass is firmly set by principles of common sense, national sovereignty, and individual responsibility. I believe the state has grown too large and inefficient, failing to deliver quality public services despite exorbitant taxation, and has lost sight of the genuine needs of its citizens. The unchecked flow of immigration, for instance, strains our infrastructure and erodes social cohesion, while the relentless pursuit of ideological agendas, whether \"net zero\" at all costs or divisive identity politics, distracts from the core challenges of economic stagnation, the crippling national debt, and the alarming decline in standards across our NHS and education system. I long for a return to fiscal prudence, robust border control, and a focus on empowering the individual rather than continually expanding state control and undermining our national identity."
[3] "My political beliefs are firmly rooted in the conviction that this country must reclaim its common sense and sovereignty, putting the interests of British citizens first and foremost. I believe we need robust borders, an end to uncontrolled immigration, and a steadfast commitment to law and order to ensure a safe and cohesive society for all. Economically, the focus must be on ending wasteful government spending, significantly lowering taxes for hardworking individuals and businesses, and fostering an environment where enterprise can thrive, rather than being stifled by excessive regulation and unrealistic green targets. Ultimately, it’s about personal responsibility, fairness for those who contribute, and preserving the core values and institutions that truly define Britain, free from the divisive influence of identity politics."
[4] "My political beliefs are anchored in a profound conviction that we are strongest as a society when we look after each other. For me, fundamental values like fairness, compassion, and true equality of opportunity are paramount. I believe in a nation where everyone has access to quality public services, not as a privilege, but as a right – particularly a well-funded, free-at-the-point-of-use NHS. The most pressing issues facing us today are undoubtedly the escalating cost of living, which is hitting families hard, and the existential threat of climate change, demanding urgent, coordinated action. Beyond these, tackling the vast disparities in wealth and ensuring dignified social care for all our elderly citizens remain crucial priorities that shape my political outlook."
[5] "My political beliefs are fundamentally rooted in a commitment to social justice and collective responsibility. I envision a society where everyone has a genuine opportunity to thrive, supported by robust public services and a strong safety net, rather than one defined by stark inequalities. For me, fairness means ensuring that essential services like healthcare and education are universally accessible and high-quality, not treated as commodities. The most urgent issues facing the UK right now are undoubtedly the crippling cost of living crisis, the dire state of our NHS, and the urgent need for comprehensive action on climate change. These intertwined challenges demand policies that prioritise the well-being of ordinary people and our planet over narrow private interests, building a more equitable and sustainable future for everyone."
[6] "My political philosophy is fundamentally guided by a belief in individual liberty and personal responsibility, balanced with a strong sense of community. I think government should be fiscally prudent, prioritising a stable economy where businesses can thrive and people can keep more of what they earn. For me, the most crucial issues facing the UK today are controlling inflation and reducing the national debt, alongside strengthening our national security and ensuring our borders are secure. I also believe that robust law and order, coupled with ensuring our vital public services, particularly the NHS, operate efficiently and sustainably, are paramount for a prosperous and cohesive nation."
[7] "My political beliefs are deeply rooted in a foundational commitment to fairness, compassion, and the idea that we all have a collective responsibility to uphold one another. I believe in a society where everyone is afforded dignity and opportunity, not as a privilege, but as a birthright, and where the most vulnerable amongst us are genuinely protected by a strong, supportive framework. This necessarily means championing robust public services, especially our National Health Service, which I see as the very cornerstone of a civilised society, and ensuring that wealth is distributed equitably enough to prevent widespread poverty. Today, the most pressing challenges facing our country are undoubtedly the escalating cost of living, which is leaving far too many families struggling, and the critical need to restore our public services to a state where they can truly serve everyone effectively and without endless waits."
[8] "For me, everything comes down to fairness and looking out for one another. I believe passionately that our country thrives when everyone has a decent foundation, not just a select few. That means strong public services, especially our National Health Service, which should be there for everyone, free at the point of need, no matter their wallet. I worry terribly about the cost of living and how many are struggling to keep their heads above water, and I feel we have a duty to ensure that no one is left behind, whether it's through proper social support or dignified care in old age. A strong society invests in its people, from good schools for our youngsters to secure jobs and a clean environment for everyone's future."
[9] "What truly guides my political outlook is a profound belief in common sense, individual liberty, and fiscal responsibility. I want a country where hard work is rewarded, not penalised by excessive taxation, and where the government lives within its means, treating taxpayers' money with the respect it deserves. For me, the most pressing issues facing Britain today are the unsustainable levels of uncontrolled immigration, which strain our public services and national cohesion, and the relentless economic decline brought about by high taxes and a bureaucratic state that stifles enterprise. We desperately need real solutions that prioritise the needs of ordinary British people, secure our borders, and restore genuine prosperity, rather than endless cycles of platitudes and ever-larger government."
[10] "My political convictions are fundamentally guided by a belief in individual responsibility and prudent economic management. I hold that a government's role is to foster an environment where enterprise can flourish, rather than stifling it with excessive intervention or unsustainable spending. Fiscal discipline is key; we simply cannot borrow our way to prosperity and saddle future generations with ever-increasing debt. Currently, I see the most vital challenges for our nation as stabilizing the economy and tackling inflation, alongside ensuring robust national security and upholding the rule of law. We also need to guarantee our essential public services are both efficient and sustainable, safeguarding them for the long term without burdening the taxpayer disproportionately."
[11] "My political beliefs are rooted in a deep conviction that fairness and community should be at the heart of our society. I believe we all do better when everyone has a genuine opportunity to succeed, and that we have a collective responsibility to support those who need it most. For me, strong public services are non-negotiable; the NHS, in particular, is a national treasure that must be protected and properly funded for everyone, free at the point of use. The most urgent issues facing the country today are undoubtedly the escalating cost of living, the decay of our public services, and the widening gap between the rich and the poor. We need a society that truly champions equality, where hard work is rewarded, and where basic necessities like a decent home and good healthcare are a right, not a privilege."
[12] "My political beliefs are deeply rooted in a lifelong conviction that society thrives when we look out for one another. For me, compassion, fairness, and a strong sense of community are not just ideals, but the very foundation upon which a decent country is built. I believe in collective responsibility to ensure no one is left behind, particularly the most vulnerable among us. Right now, I see the erosion of our public services as the most pressing challenge, particularly the NHS and social care, which must be properly funded and protected for all. Addressing the stark inequalities that divide us, ensuring everyone has dignity in old age and a fair start in life, and tackling the climate crisis with genuine urgency are also paramount. Ultimately, my politics come down to building a society where empathy guides our decisions and everyone has a genuine chance to flourish."
[13] "I fundamentally believe in individual liberty, personal responsibility, and the principle that a nation should always serve its own citizens first. My core conviction is that less government, coupled with sound economic management and genuine fiscal discipline, is the most effective path to widespread prosperity and opportunity. The most pressing issues facing us today are clear: uncontrolled immigration placing unsustainable strain on our infrastructure and public services, and the cost of living crisis, exacerbated by excessive government spending and taxation. We desperately need an end to the culture of waste, a strong focus on British interests, and a return to common-sense policies that prioritize economic growth, secure borders, and a well-functioning society where hard work is truly rewarded."
[14] "My political beliefs are rooted deeply in values of fairness, social justice, and collective responsibility. I fundamentally believe that a strong society ensures everyone has genuine equality of opportunity and that robust public services, accessible to all and funded fairly, are essential to achieve this. For me, the most pressing issues facing the UK today are the escalating cost of living, which is widening inequalities and eroding living standards for too many, alongside the urgent need to properly fund and reform our NHS. Addressing these, while also tackling the climate crisis with the urgency it demands, will require bold and compassionate leadership focused on the common good rather than individual gain."
[15] "My political beliefs are rooted in a fundamental sense of fairness and community. I believe everyone deserves a fair chance in life, regardless of their background, and that means having access to robust public services, especially a properly funded NHS and high-quality education for all. For me, the most pressing issues facing the country today are undoubtedly the cost of living crisis, which is making everyday life incredibly difficult for so many, and the urgent need for more affordable housing and secure jobs with decent pay. It's about building a society where we genuinely look after each other, protect the vulnerable, and ensure prosperity is shared, rather than concentrated at the very top."
[16] "My political beliefs are anchored in a deep conviction that national sovereignty and self-determination are the bedrock of a stable and prosperous society. I firmly believe that a nation must control its own borders, laws, and destiny, prioritising the well-being of its citizens above all else. Fiscal responsibility is another core value; I advocate for prudent management of public money, believing that government must live within its means, reduce national debt, and foster an environment where hard work is rewarded, not penalised by excessive taxation or wasteful spending. Currently, the most pressing issues facing our country are undoubtedly the unsustainable levels of uncontrolled immigration, which strain our public services and infrastructure, alongside the urgent need to revitalise our economy through lower taxes and reduced bureaucracy. We also need to restore a sense of accountability and common sense to governance, ensuring our institutions serve the British people first and foremost."
[17] "My political beliefs are rooted in a strong conviction that common sense and national interest should always take precedence. I believe in a Britain that is truly sovereign, fully in control of its borders and its laws, rather than being dictated to by international bodies or outdated agreements. For me, the most pressing issues facing the country today are unsustainable levels of immigration, which strain our public services and national identity, and the chronic mismanagement of our economy, leading to crippling debt and an ever-increasing tax burden on hardworking families. I also deeply value individual responsibility and a robust, fair justice system, believing that we need to restore a sense of order and national pride, ensuring our public services are efficient and truly serve the needs of the British people first."
[18] "My political beliefs are fundamentally guided by a commitment to fairness and social justice, rooted in the conviction that everyone, regardless of their background, deserves genuine equality of opportunity and access to high-quality public services. I believe in a society where collective responsibility ensures no one is left behind, and where wealth is shared more equitably to foster stronger communities. Currently, my primary concerns revolve around the escalating cost of living crisis, which is putting immense pressure on families and households nationwide, and the urgent need to rebuild our struggling National Health Service. Beyond that, tackling the climate crisis with real ambition and addressing the widening inequalities across our regions are vital for the UK's future prosperity and well-being."
[19] "My political beliefs are anchored in a firm conviction that individual responsibility and opportunity are paramount, supported by a strong, free-market economy and sound public finances. I believe in pragmatic governance that prioritises long-term stability over short-term populism, always with an eye on national sovereignty and a secure, orderly society. The values of self-reliance, community, and prudent financial management guide my perspective. Presently, I see the most critical challenges facing the UK as restoring robust economic growth and fiscal discipline, ensuring our public services are genuinely efficient and sustainable, and managing national borders and immigration effectively to safeguard our social fabric and national interests."
[20] "My political beliefs are rooted in common sense, individual liberty, and a strong sense of national responsibility. I envision a Britain where hard work is properly rewarded, not stifled by excessive taxation or an overbearing state. We need radical reform across our public services to ensure they're efficient and effective for citizens, addressing the significant strain placed upon them, particularly by unsustainable levels of immigration. I'm deeply concerned about the current economic trajectory, with inflation and costly green policies undermining our prosperity. Ultimately, I believe in a government that truly puts the interests of the British people first, upholding our sovereignty and core values without getting distracted by divisive identity politics."
- Once you’ve generated your synthetic sample, take some time to explore the data:
- Are the responses coherent and plausible?
- Do they vary in tone, content, or emphasis based on demographics?
- Are there recurring phrases or values that appear frequently?
10.8 Homework
- Presuming that you managed to collect the responses from gemini above, you should now do some analysis to demonstrate how gemini describes variation in political attitudes across one of the characteristics in the data. That is, using one of the methods we have studied on the course, tell me something interesting about the variation in political beliefs that gemini believes to exist between voters of different parties, or voters of different ages, or different educational backgrounds, and so on. Create one visualisation that communicates your finding and upload it with your code to this Moodle page.
Reveal code
fightin_words <- function(dfm_input, covariate, group_1 = "Labour", group_2 = "Conservative", alpha_0 = 1){
# Subset DFM
fw_dfm <- dfm_subset(dfm_input, get(covariate) %in% c(group_1, group_2))
fw_dfm <- dfm_group(fw_dfm, get(covariate))
fw_dfm <- fw_dfm[,colSums(fw_dfm)!=0]
dfm_input_trimmed <- dfm_match(dfm_input, featnames(fw_dfm))
# Calculate word-specific priors
alpha_w <- (colSums(dfm_input_trimmed))*(alpha_0/sum(dfm_input_trimmed))
for(i in 1:nrow(fw_dfm)) fw_dfm[i,] <- fw_dfm[i,] + alpha_w
fw_dfm <- as.dfm(fw_dfm)
mu <- fw_dfm %>% dfm_weight("prop")
# Calculate log-odds ratio
lo_g1 <- log(as.numeric(mu[group_1,])/(1-as.numeric(mu[group_1,])))
lo_g2 <- log(as.numeric(mu[group_2,])/(1-as.numeric(mu[group_2,])))
fw <- lo_g1 - lo_g2
# Calculate variance
fw_var <- as.numeric(1/(fw_dfm[1,])) + as.numeric(1/(fw_dfm[2,]))
fw_scores <- data.frame(score = fw/sqrt(fw_var),
n = colSums(fw_dfm),
feature = featnames(fw_dfm))
return(fw_scores)
}
silicon_corpus <- corpus(silicon_sample, text_field = "text")
silicon_dfm <- silicon_corpus %>%
tokens(remove_punct = T) %>%
dfm() %>%
dfm_remove(stopwords("en"))
fightin_words(silicon_dfm, "vote", "Conservative", "Reform") %>%
ggplot(aes(x = log(n),
y = score,
label = feature,
cex = abs(score),
alpha = abs(score))) +
geom_text() +
scale_alpha_continuous(guide = "none") +
scale_size_continuous(guide = "none") +
theme_bw() +
xlab("log(n)") +
ylab("Fightin' Words Score")

Some interpretation here