Views
No views yet
| Models | FPB | FIQA-SA | Headlines | NER |
|---|---|---|---|---|
| BloombergGPT | 0.51 | 0.75 | 0.82 | 0.61 |
| GPT-4 | 0.78 | - | 0.86 | 0.83 |
| FinMA-7B | 0.86 | 0.84 | 0.98 | 0.75 |
| FinMA-30B | 0.88 | 0.87 | 0.97 | 0.62 |
| Pythia-1.4B | 0.84 | 0.83 | 0.97 | 0.69 |
prompt = "\n".join([
'### Instruction: YOUR_INSTRUCTION',
'### Text: YOUR_SENTENCE',
'### Answer:'])### Instruction: Analyze the sentiment of this statement extracted from a financial news article. Provide your answer as either negative, positive, or neutral.\n### Text: The economic uncertainty caused by the ongoing trade tensions between major global economies has led to a sharp decline in investor confidence, resulting in a significant drop in the stock market.\n### Answer:1 prompt = "### Instruction: Analyze the sentiment of this statement extracted from a financial news article. Provide your answer as either negative, positive, or neutral.\n### Text: XYZ reported record-breaking profits for the quarter, exceeding analyst expectations and driving their stock price to new highs.\n### Answer:"
2 target_classes = ["positive", "negative", "neutral"]
3
4 target_class_ids = tokenizer.convert_tokens_to_ids(target_classes)
5 inputs = tokenizer(prompt, return_tensors="pt", add_special_tokens=False).to(args.device)
6 outputs = model(inputs.input_ids)
7 top_output = outputs.logits[0][-1][target_class_ids].argmax(dim=0)
8 print(target_classes[top_output])@misc{lc_finnlp2023,
title={Large Language Model Adaptation for Financial Sentiment Analysis},
author={Rodriguez Inserte Pau and Nakhlé Mariam and Qader Raheel and Caillaut Gaëtan and Liu Jingshu},
year={2023},
}