Prepare the data
Use a public-domain or licensed corpus and split by document to reduce leakage.
Predict the next token. Inspect the generated passage.
An RNN language model predicts successive characters or tokens. Sampling temperature changes diversity, but generated fluency is not evidence of factual accuracy.
Learning concept · Not a validated service
An RNN language model predicts successive characters or tokens. Sampling temperature changes diversity, but generated fluency is not evidence of factual accuracy.
A possible application for language technology classes: Help writing-technology classes explore probabilistic text continuation on public-domain material. This extension is not delivered by the supplied starter.
Use a public-domain or licensed corpus and split by document to reduce leakage.
Train a small recurrent next-token model and implement seeded sampling with temperature control.
Measure held-out loss and inspect repetition, memorised passages and invalid output.
Label all generated text and keep the demo separate from factual advice or impersonation.
The supplied starter splits six hand-written sentences with binary labels, fits a TF-IDF unigram/bigram vectoriser and LogisticRegression pipeline, then prints a report and one sample prediction.
model = Pipeline(
steps=[
("tfidf", TfidfVectorizer(ngram_range=(1, 2), min_df=1)),
("classifier", LogisticRegression(max_iter=1000)),
]
)
model.fit(X_train, y_train)
predictions = model.predict(X_test)
print(classification_report(y_test, predictions, zero_division=0))The source predicts a binary text label; it has no recurrent decoder or text-generation loop. A two-example test set cannot support useful performance claims. The sentences are not a representative corpus, and their binary labels do not establish the richer task described in the project title.
Proposed extension: Help writing-technology classes explore probabilistic text continuation on public-domain material.
This is a potential application pathway, not a delivered product. The supplied starter does not implement this service or validate it with real users.
Networkers Home runs this topic inside its AI Engineer Course, with placement support and hands-on labs.