Skip to content
Snippets Groups Projects
Commit efe96d2d authored by ivan.pavlovic's avatar ivan.pavlovic
Browse files

Prediction test on small texts

parent 7dc61c6e
No related branches found
No related tags found
No related merge requests found
gptKey
.venv
\ No newline at end of file
This diff is collapsed.
File added
File added
......@@ -71,6 +71,8 @@ for key in obj.keys():
print(meshTerms)
input("Press Enter to continue...")
if i > 20:
break
......
docImg/smallTextPredictions.png

435 KiB

import model.facebookBartLargeMnli as facebookBartLargeMnli
data = [
{
"title": "Journal of managed care & specialty pharmacy",
"articleTitle": "Area deprivation index impact on type 2 diabetes outcomes in a regional health plan.",
"abstract": "Significant differences were identified between ADI quintiles 1 and 5 for noninsulin diabetes medication adherence, frequency of A1c test claims, all-cause health care service utilization, and total cost of care. There were no statistically significant differences between ADI quintiles for achievement of A1c goal or receipt of comorbidity-focused therapies."
},
{
"title": "Sleep & breathing = Schlaf & Atmung",
"articleTitle": "The association between chemosensitivity and the 10-year risk of type 2 diabetes in male patients with obstructive sleep apnea.",
"abstract": "Higher peripheral chemosensitivity was associated with an increased 10-year T2D risk, as calculated using a risk calculator based on clinical variables. For outcomes that reflect a moderate-to-high 10-year risk of T2D, the severity of OSA did not significantly affect the risk, irrespective of whether patients exhibited relatively low or high chemosensitivity."
},
{
"title": "Sleep & breathing = Schlaf & Atmung",
"articleTitle": "The effect of physical activity on sleep quality in people with diabetes: systematic review and meta-analysis.",
"abstract": "Preliminary evidence suggests that exercise can be prescribed to manage self-reported sleep quality in this population, although its effects may not surpass those of usual care."
},
{
"title": "Frontiers in endocrinology",
"articleTitle": "Predicting hypoglycemia in elderly inpatients with type 2 diabetes: the ADOCHBIU model.",
"abstract": "ChiCTR2200062277. Registered on 31 July 2022."
},
{
"title": "Diabetes & metabolism journal",
"articleTitle": "Cardiovascular Disease & Diabetes Statistics in Korea: Nationwide Data 2010 to 2019.",
"abstract": "The incidence of most CVD (IHD, ischemic stroke, and PAD) decreased between 2010 and 2019, whereas the incidence of HF increased. The overall use of high-intensity statins, SGLT2i, and GLP-1RA remained low among individuals with T2DM and CVD."
}
]
for obj in data:
title = obj["title"]
articleTitle = obj["articleTitle"]
abstract = obj["abstract"]
print(f"Title: {title}")
print(f"ArticleTitle: {articleTitle}")
print(f"Abstract: {abstract}")
results = facebookBartLargeMnli.classify(title + " \n " + articleTitle + " \n " + abstract)
print(f"Labels: {results["labels"]}")
print(f"Scores: {results["scores"]}")
print()
\ No newline at end of file
# Tests
## facebookBartLargeMnli
### Small texts
I wanted to test the acuracy of the predictions of "facebookBartLargeMnli" on small texts to see if the lenght of the content has influence on the accuracy of the prediction.
I selected 5 entries from Pubmed with the mesh terms "Diabetes Mellitus" that where not to long. After that i predicted the corelation between the keywords ("Diabetes", "Cancer", "Chronic respiratory disease", "Cardiovascular diseases", "Mental Health", "Diabetes type 1", "Diabetes type 2") and the selected entries. I got the followin reasults:
For an entrie that have:
- Title: Frontiers in endocrinology
- Abstract title: Predicting hypoglycemia in elderly inpatients with type 2 diabetes: the ADOCHBIU model.
- Abstract : ChiCTR2200062277. Registered on 31 July 2022.
- Results: 'Diabetes type 2' -> 0.7203449606895447 (~ 72%)
Results for the 5 entries:
![5 entries prediction](../docImg/smallTextPredictions.png)
I saw that the lenght of the text didn't really have an impact on the acuracy of the prediction.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment