Model Description

Fine-tuned Mistral-7B model for cryptocurrency news multilevel analytics (English language). It was fine-tuned using Peft/LoRA approach with 4-Bit quantization. Given the news text, the model can generate graph and text summaries with sentiment signals. Graph and text summaries and be summarized on the stacking level and graph and text summaries of summaries can be stacked into one diversified summary. Using graph presentation can be improve trend estimation accuracy for cryptocurrencies and eliminate LLM halucinations.

How to Get Started with the Model

Fine-tuned model can be tested on Google Colab using Nvidia A100 or L4 GPU.

Pakages installation:

pip install transformers bitsandbytes peft

Use the code below to get started with the model:

from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
from huggingface_hub import login

#Login to Huggingface to load Mistral LLM
login("Huggingface access token")

model_id = "mistralai/Mistral-7B-Instruct-v0.1"
peft_model_name="bpavlsh/Mistral-crypto-news"

#Choose prompt query
prompt_query_1="Generate a knowledge graph from cryptocurrency news:"
prompt_query_2="Generate summaries of cryptocurrency news and detect sentiment signals:"
prompt_query_3="Create a JSON representation of the summary of cryptocurrency news:"

tokenizer = AutoTokenizer.from_pretrained(model_id)
base_model = AutoModelForCausalLM.from_pretrained( model_id, load_in_4bit=True,
                                  device_map="auto", torch_dtype="auto")
model = PeftModel.from_pretrained(base_model, peft_model_name)

tokenizer = AutoTokenizer.from_pretrained(model_id)
base_model = AutoModelForCausalLM.from_pretrained( model_id, load_in_4bit=True,
                                  device_map="auto", torch_dtype="auto")
model = PeftModel.from_pretrained(base_model, peft_model_name)

text=""" News text for analysis, from 1Kb to 10Kb """

prompt = f"""<s>[INST] <<SYS>>
You are an expert in analyzing cryptocurrency news.
<</SYS>>

{prompt_query_1}
{text} [/INST]"""

inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
output = model.generate(**inputs, max_new_tokens=1500)
output_result=tokenizer.decode(output[0], skip_special_tokens=True)
result=output_result.split('[/INST]')[1]
print(f"\n{result}")

References

Pavlyshenko B.M. Analysis of Disinformation and Fake News Detection Using Fine-Tuned Large Language Model. arXiv preprint arXiv:2309.04704. 2023. Download PDF: https://arxiv.org/pdf/2309.04704.pdf

Pavlyshenko B.M. Financial News Analytics Using Fine-Tuned Llama 2 GPT Model. arXiv preprint arXiv:2308.13032. 2023. Download PDF: https://arxiv.org/pdf/2308.13032.pdf

Pavlyshenko B.M. AI Approaches to Qualitative and Quantitative News Analytics on NATO Unity. arXiv preprint arXiv:2505.06313. 2025. Download PDF: https://arxiv.org/pdf/2505.06313

Disclaimer

We are sharing a considered model and results for academic purpose only, not any advice or recommendations.

Contacts

B. Pavlyshenko https://www.linkedin.com/in/bpavlyshenko

Downloads last month
10
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for bpavlsh/Mistral-crypto-news

Adapter
(423)
this model