SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2005.04232 · ACL · 2020

Text-Based Ideal Points

David Blei, Keyon Vafa, Suresh Naidu, Amy Klobuchar, Susan Collins, Mark Warner, Rand Paul, Ben Sasse, Marco Rubio, Mitch Mcconnell (r-Ky, John Mccain

arXiv · PDF · Open in the Atlas

Code that ran

8 of 16 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 0 failures of our instrument; 8 no recorded run), measured 2026-11-21; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2005.04232.json · badge: /api/ran/2005.04232.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
keyonvafa/tbip canonical (classifier label)
classifier basis: census
8 ran · 8 no recorded run
FunctionStatusWhere it lives
load_tbip_parameters Ran
ran on a synthesized input
keyonvafa/tbip/analysis/analysis_utils.py
code served (permissive licence) · get_code("f6ee747b5d58b1d4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import os
import tempfile
import shutil

# Create a temporary directory with the required .npy files
temp_dir = tempfile.mkdtemp()

# Define small parameter arrays
num_documents = 2
num_topics = 3
num_words = 4
num_authors = 5

# Create and save the parameter files
np.save(os.path.join(temp_dir, 'document_loc.npy'), np.random.randn(num_documents, num_topics))
np.save(os.path.join(temp_dir, 'document_scale.npy'), np.abs(np.random.randn(num_documents, num_topics)))
np.save(os.path.join(temp_dir, 'objective_topic_loc.npy'), np.random.randn(num_topics, num_words))
np.save(os.path.join(temp_dir, 'objective_topic_scale.npy'), np.abs(np.random.randn(num_topics, num_words)))
np.save(os.path.join(temp_dir, 'ideological_topic_loc.npy'), np.random.randn(num_topics, num_words))
np.save(os.path.join(temp_dir, 'ideological_topic_scale.npy'), np.abs(np.random.randn(num_topics, num_words)))
np.save(os.path.join(temp_dir, 'ideal_point_loc.npy'), np.random.randn(num_authors))
np.save(os.path.join(temp_dir, 'ideal_point_scale.npy'), np.abs(np.random.randn(num_authors)))

ARGS = {
    'param_dir': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
print_polarities Ran
ran on a synthesized input
keyonvafa/tbip/model_comparison/wordfish.py
code served (permissive licence) · get_code("0bf4d20e073ea024")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small vocabulary of 30 words
vocabulary = [
    'terrible', 'awful', 'horrible', 'bad', 'poor', 'worse', 'disgusting', 'hate', 'evil', 'ugly',
    'worse', 'sad', 'painful', 'dark', 'negative', 'wrong', 'false', 'broken', 'sick', 'dead',
    'cold', 'harsh', 'cruel', 'bitter', 'sour',
    'good', 'great', 'wonderful', 'excellent', 'amazing'
]

# Create polarity_mean with 30 values
# Lower values = more negative polarity, higher values = more positive polarity
polarity_mean = np.array([
    -2.5, -2.3, -2.1, -1.9, -1.7, -1.5, -1.3, -1.1, -0.9, -0.7,
    -0.5, -0.3, -0.1, 0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3,
    1.5, 1.7, 1.9, 2.1, 2.3, 2.5, 2.7, 2.9, 3.1, 3.3
])

ARGS = {
    'polarity_mean': polarity_mean,
    'vocabulary': vocabulary
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
print_polarities Ran
ran on a synthesized input
keyonvafa/tbip/model_comparison/wordshoal.py
code served (permissive licence) · get_code("c5135efa6ed5cc1e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (50,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create polarity_mean: shape [num_words, num_debates]
# Using distinct sizes: 15 words, 60 debates (so we have enough for 50 debates_to_print)
num_words = 15
num_debates = 60
polarity_mean = np.random.randn(num_words, num_debates).astype(np.float32)

# Create vocabulary: list of words with length num_words
vocabulary = [f"word_{i}" for i in range(num_words)]

ARGS = {
    "polarity_mean": polarity_mean,
    "vocabulary": vocabulary,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (50,) — shape (50,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
print_topics Ran
ran on a synthesized input
keyonvafa/tbip/tbip.py
code served (permissive licence) · get_code("6e01dac2264070fb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Define parameters
num_topics = 2
num_words = 15

# Create small random matrices for the topic means
# Shape: [num_topics, num_words]
neutral_mean = np.random.rand(num_topics, num_words).astype(np.float32)
negative_mean = np.random.rand(num_topics, num_words).astype(np.float32)
positive_mean = np.random.rand(num_topics, num_words).astype(np.float32)

# Create a vocabulary list with num_words entries
vocabulary = [f"word_{i}" for i in range(num_words)]

ARGS = {
    "neutral_mean": neutral_mean,
    "negative_mean": negative_mean,
    "positive_mean": positive_mean,
    "vocabulary": vocabulary,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
print_topics Ran
ran on a synthesized input
keyonvafa/tbip/tbip_with_gamma.py
code served (permissive licence) · get_code("dd1b6ed6959cb67f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set seed for reproducibility
np.random.seed(0)

# Create small test data
num_topics = 2
num_words = 4

# Create mean tensors with shape [num_topics, num_words]
# Using random values that will have meaningful orderings
neutral_mean = np.random.rand(num_topics, num_words).astype(np.float32)
negative_mean = np.random.rand(num_topics, num_words).astype(np.float32)
positive_mean = np.random.rand(num_topics, num_words).astype(np.float32)

# Create vocabulary list with num_words entries
vocabulary = ['word0', 'word1', 'word2', 'word3']

ARGS = {
    'neutral_mean': neutral_mean,
    'negative_mean': negative_mean,
    'positive_mean': positive_mean,
    'vocabulary': vocabulary
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
print_topics Ran
ran on a synthesized input
keyonvafa/tbip/pytorch/tbip.py
code served (permissive licence) · get_code("61a4ee8a882a522e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Set random seed for reproducibility
np.random.seed(0)

# Define small matrices for the three mean topic distributions
num_topics = 2
num_words = 15

# Create random topic-word distributions (higher values = more relevant words)
neutral_mean = np.random.rand(num_topics, num_words) * 10
negative_mean = np.random.rand(num_topics, num_words) * 10
positive_mean = np.random.rand(num_topics, num_words) * 10

# Create a small vocabulary
vocabulary = [
    'good', 'bad', 'happy', 'sad', 'love', 'hate', 'beautiful', 'ugly',
    'amazing', 'terrible', 'wonderful', 'awful', 'excellent', 'poor', 'fantastic'
]

ARGS = {
    'neutral_mean': neutral_mean,
    'negative_mean': negative_mean,
    'positive_mean': positive_mean,
    'vocabulary': vocabulary
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
standardize Ran
ran on a synthesized input
keyonvafa/tbip/model_comparison/wordfish.py
code served (permissive licence) · get_code("4b456450e27b5ac7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (5,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Construct a simple numpy array to standardize
x = np.array([1.0, 2.0, 3.0, 4.0, 5.0])

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
standardize Ran
ran on a synthesized input
keyonvafa/tbip/analysis/make_figures.py
code served (permissive licence) · get_code("700d962137ee7a91")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 1, dtype family float, shape (5,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a simple vector to standardize
x = np.array([1.0, 2.0, 3.0, 4.0, 5.0])

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
build_input_pipeline Not yet run
unverified (harvested, no recorded run)
keyonvafa/tbip/tbip.py
code served (permissive licence) · get_code("28d90e257f731884")
How it ran

no invocation recorded.

build_input_pipeline Not yet run
unverified (harvested, no recorded run)
keyonvafa/tbip/tbip_with_gamma.py
code served (permissive licence) · get_code("fba3ebe632a7e3f6")
How it ran

no invocation recorded.

build_input_pipeline Not yet run
unverified (harvested, no recorded run)
keyonvafa/tbip/model_comparison/wordfish.py
code served (permissive licence) · get_code("27f0e8c4faf5c8b8")
How it ran

no invocation recorded.

build_input_pipeline Not yet run
unverified (harvested, no recorded run)
keyonvafa/tbip/model_comparison/wordshoal.py
code served (permissive licence) · get_code("b4d205244112bc46")
How it ran

no invocation recorded.

build_lognormal_variational_parameters Not yet run
unverified (harvested, no recorded run)
keyonvafa/tbip/tbip.py
code served (permissive licence) · get_code("2665a9632c177468")
How it ran

no invocation recorded.

load_text_data Not yet run
unverified (harvested, no recorded run)
keyonvafa/tbip/analysis/analysis_utils.py
code served (permissive licence) · get_code("ff0ead68a2b53eef")
How it ran

no invocation recorded.

load_vote_data Not yet run
unverified (harvested, no recorded run)
keyonvafa/tbip/analysis/analysis_utils.py
code served (permissive licence) · get_code("8b0089dbde346de5")
How it ran

no invocation recorded.

print_ideal_points Not yet run
unverified (harvested, no recorded run)
keyonvafa/tbip/tbip_with_gamma.py
code served (permissive licence) · get_code("6f0a02b3896ed08d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 15 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 15 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-21.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Ideal point models analyze lawmakers' votes to quantify their political positions, or ideal points. But votes are not the only way to express a political position. Lawmakers also give speeches, release press statements, and post tweets. In this paper, we introduce the text-based ideal point model ( ), an unsupervised probabilistic topic model that analyzes texts to quantify the political positions of its authors. We demonstrate the with two types of politicized text data: U.S. Senate speeches and senator tweets. Though the model does not analyze their votes or political affiliations, the separates lawmakers by party, learns interpretable politicized topics, and infers ideal points close to the classical vote-based ideal points. One benefit of analyzing texts, as opposed to votes, is that the can estimate ideal points of anyone who authors political texts, including non-voting actors. To this end, we use it to study tweets from the 2020 Democratic presidential candidates. Using only the texts of their tweets, it identifies them along an interpretable progressive-tomoderate spectrum. Bernie Sanders (I-VT) Elizabeth Warren (D-MA) Sherrod Brown (D-OH) Chuck Schumer (D-NY)

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2005.04232")
get_code_for_paper("2005.04232")
have("2005.04232")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2005.04232.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2005.04232.svg)](https://syntology.ai/paper/2005.04232)

Connect an agent — have() is free.