--- datasets: - ElKulako/stocktwits-crypto --- # CryptoBERT CryptoBERT is a pre-trained NLP model to analyse the language and sentiments of cryptocurrency-related social media posts and messages. It was built by further training the [cardiffnlp's Twitter-roBERTa-base](https://huggingface.co/cardiffnlp/twitter-roberta-base) language model on the cryptocurrency domain, using a corpus of over 3.2M unique cryptocurrency-related social media posts. ## Classification Training The model was trained on the following labels: "Bearish" : 0, "Neutral": 1, "Bullish": 2 CryptoBERT's sentiment classification head was fine-tuned on a balanced dataset of 2M labelled StockTwits posts, bootstrapped from [ElKulako/stocktwits-crypto](https://huggingface.co/datasets/ElKulako/stocktwits-crypto). CryptoBERT was trained with a max sequence length of 128. Technically, it can handle sequences of up to 514 tokens, however, going beyond 128 is not recommended. # Classification Example ```python >>> from transformers import TextClassificationPipeline, AutoModelForSequenceClassification, AutoTokenizer >>> from datasets import load_dataset >>> dataset_name = "ElKulako/stocktwits-crypto" >>> dataset = load_dataset(dataset_name) >>> model_name = "ElKulako/cryptobert" >>> tokenizer_ = AutoTokenizer.from_pretrained(model_name, use_fast=True) >>> model = AutoModelForSequenceClassification.from_pretrained(model_name, num_labels = 3) >>> pipe = TextClassificationPipeline(model=model, tokenizer=tokenizer, batch_size=64, max_length=64, truncation=True, padding = 'max_length') >>> preds = pipe(df_posts) ``` ## Training Corpus CryptoBERT was trained on 3.2M social media posts regarding various cryptocurrencies. Only non-duplicate posts of length above 4 words were considered. The following communities were used as sources for our corpora: (1) StockTwits - 1.875M posts about the top 100 cryptos by trading volume. Posts were collected from the 1st of November 2021 to the 16th of June 2022. [ElKulako/stocktwits-crypto](https://huggingface.co/datasets/ElKulako/stocktwits-crypto) (2) Telegram - 664K posts from top 5 telegram groups: [Binance](https://t.me/binanceexchange), [Bittrex](https://t.me/BittrexGlobalEnglish), [huobi global](https://t.me/huobiglobalofficial), [Kucoin](https://t.me/Kucoin_Exchange), [OKEx](https://t.me/OKExOfficial_English). Data from 16.11.2020 to 30.01.2021. Courtesy of [Anton](https://www.kaggle.com/datasets/aagghh/crypto-telegram-groups). (3) Reddit - 172K comments from various crypto investing threads, collected from May 2021 to May 2022 (4) Twitter - 496K posts with hashtags XBT, Bitcoin or BTC. Collected for May 2018. Courtesy of [Paul](https://www.kaggle.com/datasets/paul92s/bitcoin-tweets-14m).