Skip to content

Commit

Permalink
CommunityLM Example: Initial Jupyter Notebook (#15)
Browse files Browse the repository at this point in the history
* Added abstract functions for LM and distmod

* Resolved type-checking error

* Resolved type-checking error

* Resolved type-checking error

* Changed distmod structure

* Everything is LM commit

* Add initial community lm example

* Remove shell check

* Fix name error

---------

Co-authored-by: Rohan Modi <rohan.modi.1028@gmail.com>
  • Loading branch information
neubig and rohanmodi2810 authored Mar 2, 2024
1 parent e1f3a64 commit 873c60e
Show file tree
Hide file tree
Showing 19 changed files with 711 additions and 27 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,3 @@ jobs:
uses: pre-commit/action@v3.0.0
with:
extra_args: check-json --all-files
lint-shell-script:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: lint
uses: pre-commit/action@v3.0.0
with:
extra_args: shellcheck --all-files
4 changes: 0 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ repos:
rev: v1.34.0
hooks:
- id: yamllint
- repo: https://github.com/koalaman/shellcheck-precommit
rev: v0.9.0
hooks:
- id: shellcheck
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand Down
3 changes: 3 additions & 0 deletions examples/community_lm/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
data/
output/
rankings/
48 changes: 48 additions & 0 deletions examples/community_lm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# CommunityLM

This is a replication of the experiments from
[CommunityLM](https://arxiv.org/abs/2209.07065) (Jiang et al. 2022), which
probes partisan worldviews from language models.

## Reference

Some of this code and data was derived from the
[CommunityLM repo](https://github.com/hjian42/communitylm).

If you use this example, we would appreciate if you acknowledge
[LLMents](https://github.com/neulab/llments) and the original paper.

```bibtex
@misc{
title = "{LLMents}: A Toolkit for Language Model Experiments",
author = "
Graham Neubig and
Aakriti Kinra and
Mihir Bansal and
Qingyang Liu and
Rohan Modi and
Xinran Wan
",
year = "2024",
howpublished = "https://github.com/neulab/llments",
}
```

```bibtex
@inproceedings{jiang-etal-2022-communitylm,
title = "{C}ommunity{LM}: Probing Partisan Worldviews from Language Models",
author = "Jiang, Hang and
Beeferman, Doug and
Roy, Brandon and
Roy, Deb",
booktitle = "
Proceedings of the 29th International Conference on Computational Linguistics
",
month = oct,
year = "2022",
address = "Gyeongju, Republic of Korea",
publisher = "International Committee on Computational Linguistics",
url = "https://aclanthology.org/2022.coling-1.593",
pages = "6818--6826",
}
```
Loading

0 comments on commit 873c60e

Please sign in to comment.