Sense-specific Historical Word Usage Generation
Collection
4 items
•
Updated
(Built with Meta Llama 3)
For the version without PoS tag visit Janus.
Janus is a fine-tuned Llama 3 8B model designed to generate historically and semantically accurate word usages. It takes as input a word, its sense definition, and a year and produces example sentences that reflect linguistic usage from the specified period. This model is particularly useful for semantic change detection, historical NLP, and linguistic research.
<year><|t|><lemma><|t|><definition><|s|><historical usage sentence><|end|>
<year><|t|><lemma><|t|><definition><|p|><PoS><|p|><|s|><historical usage sentence><|end|>
meta-llama/Llama-3-8B
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "ChangeIsKey/llama3-janus-pos"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
input_text = "1800<|t|>awful<|t|>Used to emphasize something unpleasant or negative; ‘such a’, ‘an absolute’.<|p|>jj<|p|><|s|>"
inputs = tokenizer(input_text, return_tensors="pt").to("cuda")
output = model.generate(**inputs, temperature=1.0, top_p=0.9, max_new_tokens=50)
print(tokenizer.decode(output[0], skip_special_tokens=True))
For more examples, see the GitHub repository Historical Word Usage Generation
If you use Janus, please cite:
@article{Cassotti2024Janus,
author = {Pierluigi Cassotti and Nina Tahmasebi},
title = {Sense-specific Historical Word Usage Generation},
journal = {TACL},
year = {2025}
}
Base model
meta-llama/Meta-Llama-3-8B