Skip to content

Instantly share code, notes, and snippets.

@fsndzomga
Created September 12, 2023 11:35
Show Gist options
  • Save fsndzomga/b212aca096054d28436786776b3baeac to your computer and use it in GitHub Desktop.
Save fsndzomga/b212aca096054d28436786776b3baeac to your computer and use it in GitHub Desktop.
Import train dataset
from sklearn.datasets import fetch_20newsgroups
from langchain.chat_models import ChatOpenAI
categories = ['alt.atheism', 'talk.religion.misc', 'comp.graphics', 'sci.space']
newsgroups_train = fetch_20newsgroups(subset='train', remove=('headers', 'footers', 'quotes'), categories=categories)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment