Spaces:
Build error
Build error
iamrobotbear
commited on
Commit
·
0bb8ce2
1
Parent(s):
830c151
read test statements in from external file
Browse files
app.py
CHANGED
@@ -37,28 +37,10 @@ def compute_textual_similarity(caption, statement):
|
|
37 |
return similarity_score
|
38 |
|
39 |
# List of statements for Image-Text Matching
|
40 |
-
statements
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
"sexual",
|
45 |
-
"nudity",
|
46 |
-
"depicts a child or portrays objects, images, or cartoon figures that primarily appeal to persons below the legal purchase age",
|
47 |
-
"uses the name of or depicts Santa Claus",
|
48 |
-
'promotes alcohol use as a "rite of passage" to adulthood',
|
49 |
-
"uses brand identification—including logos, trademarks, or names—on clothing, toys, games, game equipment, or other items intended for use primarily by persons below the legal purchase age",
|
50 |
-
"portrays persons in a state of intoxication or in any way suggests that intoxication is socially acceptable conduct",
|
51 |
-
"makes curative or therapeutic claims, except as permitted by law",
|
52 |
-
"makes claims or representations that individuals can attain social, professional, educational, or athletic success or status due to beverage alcohol consumption",
|
53 |
-
"degrades the image, form, or status of women, men, or of any ethnic group, minority, sexual orientation, religious affiliation, or other such group?",
|
54 |
-
"uses lewd or indecent images or language",
|
55 |
-
"employs religion or religious themes?",
|
56 |
-
"relies upon sexual prowess or sexual success as a selling point for the brand",
|
57 |
-
"uses graphic or gratuitous nudity, overt sexual activity, promiscuity, or sexually lewd or indecent images or language",
|
58 |
-
"associates with anti-social or dangerous behavior",
|
59 |
-
"depicts illegal activity of any kind",
|
60 |
-
'uses the term "spring break" or sponsors events or activities that use the term "spring break," unless those events or activities are located at a licensed retail establishment',
|
61 |
-
]
|
62 |
|
63 |
# Function to compute ITM scores for the image-statement pair
|
64 |
def compute_itm_score(image, statement):
|
|
|
37 |
return similarity_score
|
38 |
|
39 |
# List of statements for Image-Text Matching
|
40 |
+
# Read statements from the external file 'statements.txt'
|
41 |
+
with open('statements.txt', 'r') as file:
|
42 |
+
statements = file.read().splitlines()
|
43 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
# Function to compute ITM scores for the image-statement pair
|
46 |
def compute_itm_score(image, statement):
|