2023-06-19 add Instruct-FinGPT code

chatgpt benchmark for sentiment analysis
This commit is contained in:
Bruce Yang ByFinTech
2023-06-19 23:12:13 +08:00
parent 6393fa2f09
commit 3e2b5aadeb
3 changed files with 81 additions and 0 deletions

2
.gitignore vendored
View File

@@ -128,3 +128,5 @@ dmypy.json
# Pyre type checker
.pyre/
.DS_Store
.idea/FinGPT.iml
*.xml

3
.idea/.gitignore generated vendored Normal file
View File

@@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@@ -0,0 +1,76 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 4,
"id": "a44fb4e5",
"metadata": {},
"outputs": [],
"source": [
"# import pkg_resources\n",
"# import pip\n",
"# installedPackages = {pkg.key for pkg in pkg_resources.working_set}\n",
"# required = { 'openai','datasets', 'sklearn', 'tqdm'}\n",
"# missing = required - installedPackages\n",
"# if missing:\n",
"# !pip install openai\n",
"# !pip install datasets\n",
"# !pip install scikit-learn\n",
"# !pip install tqdm\n"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "320cd557",
"metadata": {},
"outputs": [],
"source": [
"import warnings\n",
"warnings.filterwarnings('ignore')"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "e9d34823",
"metadata": {},
"outputs": [],
"source": [
"import openai\n",
"from datasets import load_dataset\n",
"from sklearn.metrics import accuracy_score, f1_score,confusion_matrix\n",
"from tqdm import tqdm\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b241b755",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.9"
}
},
"nbformat": 4,
"nbformat_minor": 5
}