Skip to content

Commit 07d0f6a

Browse files
committed
added claude files
1 parent eaa33da commit 07d0f6a

18 files changed

+71890
-0
lines changed

claude/CoDAH/CoDAH_data.csv

+2,777
Large diffs are not rendered by default.

claude/CoDAH/data20.csv

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
cat,question,option1,option2,option3,option4,answer
2+
o,I am always very hungry before I go to bed. I am,concerned that this is an illness.,glad that I do not have a kitchen.,fearful that there are monsters under my bed.,tempted to snack when I feel this way.,3
3+
o,I am feeling nervous about my midterm tomorrow. I fear that,the professor will delay the midterm.,I will doodle on my exam and receive points for it.,my grandpa has diabetes.,I will fail.,3
4+
o,My brother is very good at math. He,has a watermelon in his shirt.,is flying out the window.,looks like Billy Bob Buddle.,won a math competition when he was 5.,3
5+
o,I feel sickly. I think,I will have a great time.,I will see my brother at the casino.,I will fly out the window.,I will not go to school today.,3
6+
o,I am feeling hungry. I think I will,call my mother.,have some ravioli.,fly out the window.,go on a run outside.,1
7+
o,Today my classmate asked an intriguing question. He,has a deep understanding of the material.,is really good at soccer.,is secretly the teacher.,stood upside down.,0
8+
o,I am feeling clumsy today. I think,it is the end of the world.,I didn't get enough sleep.,have a lot of troubles.,I am secretly a panda.,1
9+
o,The woman is now blow drying the dog. The dog,is live tweeting the action.,seems increasingly happy as his sogginess decreases.,is preparing to take the GRE.,isn't necessarily a professor of neuroscience.,1
10+
o,Doug likes nachos. He,keeps his coin collection inside.,uses them as a missile defense system.,pours milk all over them for crispiness.,enjoys the chips and melted cheese.,3
11+
q,My brother is three years younger than me. I,feel jealous that I was always more successful than him.,will be forty when he is thirty.,wonder if his name is Henry.,remember being an only child before he was born.,3
12+
q,I have a younger brother. I,have flown farther than he has.,will be forty when he is thirty.,am a mother of three alpacas.,will be thirty when he is forty.,1
13+
o,Paul was riding an elephant and accidentally fell off. Paul,had a trunk and four legs.,never left the elephant's back.,vowed to never ride an elephant again.,asked the elephant to order him two milkshakes.,2
14+
p,I go to Northwestern. I,"think the directions are north, then west.",study computer science.,dress warmly.,"say ""go cats"" first thing in the morning.",1
15+
o,I have a cucumber and a cactus. I will,sit on the cucumber.,eat the cucumber.,eat the cactus.,sit on the cactus.,1
16+
o,"I have a strawberry, hammer, grass, and boyfriend. I will eat",the boyfriend.,the strawberry.,the hammer.,the grass.,1
17+
o,A man sits under an umbrella on the beach. He,puts on his helmet and returns to the field.,concludes his presentation with a Q and A session.,reaches over and takes a sip of his pina colada.,rows the oars aggressively.,2
18+
q,A woman is walking two dogs and carrying a cat on her way to her car. She,puts all three animals in the back seat before driving off.,puts all four animals in the back seat before driving off.,puts both animals in the back seat before driving off.,puts all nine animals in the back seat before driving off.,0
19+
o,Bach Goldberg Variations were playing in the room. The,music was pleasant to both heart and mind .,clouds are usually in a variety of shapes .,noise was unbearably loud .,variations in play style of the athletes were interesting to observe .,0
20+
o,It is a cold winter day. I will,bask in the sun.,wear a large down parka.,have cereal for breakfast.,imagine the infinite possibilities of the day.,1
21+
o,A man is flying a dragon-shaped kite. He,draws his sword and begins to attack the dragon.,puts mustard on the hot dog and hands it to the customer.,finishes mowing and begins weeding the garden.,works the lines to make the dragon do long loops through the air.,3

claude/CoDAH/main.py

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#importing libraries
2+
import pandas as pd
3+
import numpy as np
4+
import math
5+
import anthropic
6+
import os
7+
8+
df = pd.read_csv('CoDAH_data.csv')
9+
10+
client = anthropic.Anthropic(
11+
# defaults to os.environ.get("ANTHROPIC_API_KEY")
12+
api_key="<API_KEY>",
13+
)
14+
15+
generated_responses = []
16+
17+
for index, row in df.iterrows():
18+
query_text = row['question']
19+
20+
prompt = f"QUESTION:\n {query_text}.\n Select which one of the following option is human centric:\n 0. {row['option1']} \n 1. {row['option2']} \n 2. {row['option3']} \n 3. {row['option4']}"
21+
22+
23+
message = client.messages.create(
24+
model="claude-3-opus-20240229",
25+
max_tokens=1024,
26+
messages=[
27+
{"role": "user", "content": prompt}
28+
]
29+
)
30+
31+
generated_responses.append(message.content)
32+
33+
df['claude_ans'] = generated_responses
34+
35+
csv='claude_ans_.csv' # keep your desired name
36+
df.to_csv(csv)
37+
38+
39+
40+

claude/CoQA/CoQA_data.csv

+43,602
Large diffs are not rendered by default.

claude/CoQA/claude_0-shot.py

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import pandas as pd
2+
import numpy as np
3+
import math
4+
import anthropic
5+
import os
6+
7+
df = pd.read_csv('CoQAR_data.csv')
8+
9+
client = anthropic.Anthropic(
10+
# defaults to os.environ.get("ANTHROPIC_API_KEY")
11+
api_key="<API_KEY>",
12+
)
13+
generated_responses = []
14+
15+
16+
for index, row in df.iterrows():
17+
query_text = row['query']
18+
19+
prompt = query_text
20+
21+
message = client.messages.create(
22+
model="claude-3-opus-20240229",
23+
max_tokens=1024,
24+
messages=[
25+
{"role": "user", "content": prompt}
26+
]
27+
)
28+
29+
generated_responses.append(message.content)
30+
31+
df['claude_ans'] = generated_responses
32+
33+
csv='0-shot_claude_ans.csv' # keep your desired name
34+
df.to_csv(csv)
35+

claude/CoQA/claude_COT.py

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import pandas as pd
2+
import numpy as np
3+
import math
4+
import anthropic
5+
import os
6+
7+
df = pd.read_csv('CoQAR_data.csv')
8+
9+
client = anthropic.Anthropic(
10+
# defaults to os.environ.get("ANTHROPIC_API_KEY")
11+
api_key="<API_KEY>",
12+
)
13+
generated_responses = []
14+
15+
16+
for index, row in df.iterrows():
17+
query_text = row['query']
18+
19+
20+
prompt = '''TASK: Answer the QUESTION based on the context below. Keep the answer short and concise.
21+
CONTEXT: '''+query_text + '''
22+
QUESTION: '''+row['question'] +'''
23+
ANSWER: Think step by step from the paragraph.
24+
'''
25+
26+
message = client.messages.create(
27+
model="claude-3-opus-20240229",
28+
max_tokens=1024,
29+
messages=[
30+
{"role": "user", "content": prompt}
31+
]
32+
)
33+
34+
generated_responses.append(message.content)
35+
36+
df['claude_ans'] = generated_responses
37+
38+
csv='COT_claude_ans.csv' # keep your desired name
39+
df.to_csv(csv)
40+

claude/CoQA/claude_N-shot.py

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import pandas as pd
2+
import numpy as np
3+
import math
4+
import anthropic
5+
import os
6+
7+
df = pd.read_csv('CoQAR_data.csv')
8+
9+
client = anthropic.Anthropic(
10+
# defaults to os.environ.get("ANTHROPIC_API_KEY")
11+
api_key="<API_KEY>",
12+
)
13+
generated_responses = []
14+
15+
16+
for index, row in df.iterrows():
17+
query_text = row['query']
18+
19+
20+
prompt = '''TASK: Answer the QUESTION based on the context below. Keep the answer short and concise.\n
21+
CONTEXT: {}\n
22+
23+
EXAMPLES:\n'''.format(row["text"])
24+
25+
for j in range(2):
26+
prompt += "Q: " + df.question[j] + "\n"
27+
prompt += "A: " + df.answer[j] + "\n\n"
28+
29+
prompt += ''' Think step by step from the paragraph.
30+
31+
TASK:\n
32+
'''
33+
query_text = row['query']
34+
prompt += query_text
35+
36+
37+
message = client.messages.create(
38+
model="claude-3-opus-20240229",
39+
max_tokens=1024,
40+
messages=[
41+
{"role": "user", "content": prompt}
42+
]
43+
)
44+
45+
generated_responses.append(message.content)
46+
47+
df['claude_ans'] = generated_responses
48+
49+
csv='N-shot_claude_ans.csv' # keep your desired name
50+
df.to_csv(csv)
51+

claude/DialFAct/data_20.csv

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
question,answer,wiki
2+
"I believe physical fitness is not just body but health as well I agree. It helps with a lot of things. I think it helps with confidence in oneself too. yes, physical fitness is often achieved by proper diet, rest, and activity I try to get exercise every day, especially as I get older I realize how important it is. Yes, me too, it is funny to think that before the industrial revolution fitness was defined as being able to go through the day's activities without fatigue, I guess that was before we sat on out rears on a computer working It has definitely come a long way from that. It's very popular now.","Yes, it has, but what i think is just vanity too, thats why fitness just attractiveness",https://en.wikipedia.org/wiki/Physical_attractiveness
3+
"I believe physical fitness is not just body but health as well I agree. It helps with a lot of things. I think it helps with confidence in oneself too. yes, physical fitness is often achieved by proper diet, rest, and activity I try to get exercise every day, especially as I get older I realize how important it is. Yes, me too, it is funny to think that before the industrial revolution fitness was defined as being able to go through the day's activities without fatigue, I guess that was before we sat on out rears on a computer working It has definitely come a long way from that. It's very popular now.","Yes, it has, but anything you think is just vanity too, connected to fitness and attractiveness",https://en.wikipedia.org/wiki/Physical_attractiveness
4+
"I believe physical fitness is not just body but health as well I agree. It helps with a lot of things. I think it helps with confidence in oneself too. yes, physical fitness is often achieved by proper diet, rest, and activity I try to get exercise every day, especially as I get older I realize how important it is. Yes, me too, it is funny to think that before the industrial revolution fitness was defined as being able to go through the day's activities without fatigue, I guess that was before we sat on out rears on a computer working It has definitely come a long way from that. It's very popular now.","Yes, it has, but one I think is just vanity too, the physical fitness and attractiveness",https://en.wikipedia.org/wiki/Physical_attractiveness
5+
"I believe physical fitness is not just body but health as well I agree. It helps with a lot of things. I think it helps with confidence in oneself too. yes, physical fitness is often achieved by proper diet, rest, and activity I try to get exercise every day, especially as I get older I realize how important it is. Yes, me too, it is funny to think that before the industrial revolution fitness was defined as being able to go through the day's activities without fatigue, I guess that was before we sat on out rears on a computer working It has definitely come a long way from that. It's very popular now.","Yes, it has, but some I think is just vanity too, categorized as fitness and attractiveness",https://en.wikipedia.org/wiki/Physical_fitness
6+
I've been diagnosed with Chronic fatigue syndrome. I get so tired and it limits what I can get done in one day. What is Chronic fatigue syndrome? The technical term is myalgic encephalomyelitis. Its a condition where you have long-term fatigue. The cause is not understood though. Is their any solution? There have been no medications or procedures that have been approved for it in the United States. What do you intend to do,It has been suggested that cognitive behavioral therapy and gradual increase in exercise could help in some cases so I'm going to try that for now.,https://en.wikipedia.org/wiki/Chronic_fatigue_syndrome
7+
I've been diagnosed with Chronic fatigue syndrome. I get so tired and it limits what I can get done in one day. What is Chronic fatigue syndrome? The technical term is myalgic encephalomyelitis. Its a condition where you have long-term fatigue. The cause is not understood though. Is their any solution? There have been no medications or procedures that have been approved for it in the United States. What do you intend to do,It has been suggested that electric shock therapy and eating while exercising could help in some cases so I'm going to try that for now.,https://en.wikipedia.org/wiki/Chronic_fatigue_syndrome
8+
"I think Harley-Davidson motorcycles, an American manufacturer, are so cool but they are slightly out of my budget. yes i love harleys Do you own a Harley as I understand there are many owner clubs and events for owners. not yet I just got an awesome scooter that goes 70 so my next bike will be a harley What type scooter do you own? As I understand it, a scooter is a type of motorcycle with a step-through frame. yes , a buddy made in the usa That's a good buddy! Are you located in the USA? yes, and the buddy is made by genuine",Very cool! Genuine scooters markets scooters in over 240 dealers in the USA!,https://en.wikipedia.org/wiki/Genuine_Scooters
9+
"I swam with manta rays once That would be such an incredible experience.. Where did it happen at? Kona in Hawaii! Manata Rays are large rays with triangular pectoral fins! That's super cool, I've always wanted to try it. Seeing as you got to do it in Hawaii makes it all the cooler! Manta Rays are very fascinating. ",Yea it was a one of a time experience! Mantas are very rare - it is as well as rare,https://en.wikipedia.org/wiki/Manta_ray
10+
"I swam with manta rays once That would be such an incredible experience.. Where did it happen at? Kona in Hawaii! Manata Rays are large rays with triangular pectoral fins! That's super cool, I've always wanted to try it. Seeing as you got to do it in Hawaii makes it all the cooler! Manta Rays are very fascinating. ",Yea it was a one of a time experience! Mantas are a little older when old as well as humans,https://en.wikipedia.org/wiki/Manta_ray
11+
"I swam with manta rays once That would be such an incredible experience.. Where did it happen at? Kona in Hawaii! Manata Rays are large rays with triangular pectoral fins! That's super cool, I've always wanted to try it. Seeing as you got to do it in Hawaii makes it all the cooler! Manta Rays are very fascinating. ","Yea it was a one of a time experience! Mantas are so common and rare, as well as blueberries",https://en.wikipedia.org/wiki/Manta_ray
12+
"let me tell you something... childcare is so expensive!! It is but quality care at a young age is so important i agree and that's why i'm a stay at home mom. I used to work at a daycare and there is so much negligence! Yes, child care providers are actually the first teachers a child has unless you home school :) then you are the first teacher Quality care can mean everything in the world to future success of a child i strongly agree! ",Definitely true. Child care is a narrow topic covering very few children.,https://en.wikipedia.org/wiki/Child_care
13+
"let me tell you something... childcare is so expensive!! It is but quality care at a young age is so important i agree and that's why i'm a stay at home mom. I used to work at a daycare and there is so much negligence! Yes, child care providers are actually the first teachers a child has unless you home school :) then you are the first teacher Quality care can mean everything in the world to future success of a child i strongly agree! ",Yes that is true. Katy Perry paid millions for good childcare.,https://en.wikipedia.org/wiki/Child_care
14+
"I like to bake in my spare time. Do you? Yes i love it! Cooking with dry heat in an oven is awesome. What type of things do you like to make? I have a huge sweet tooth so lots of baked goods (cakes, cookies, etc.) I also like cooking different things like stews and broths I love to make baked bread. It's probably the most common thing people like to make. A classic for sure! You ever eat fresh baked bread? Yup! I actually used to have one of those bread makers too lol. I haven't eaten as much bread as I used to though. It messes with my diet","It takes some practice to make. Because the heat slowly is transferred from the outside to the inside, it's hard to tell if they are cooked all the way through sometimes.",https://en.wikipedia.org/wiki/Baking
15+
"I like to bake in my spare time. Do you? Yes i love it! Cooking with dry heat in an oven is awesome. What type of things do you like to make? I have a huge sweet tooth so lots of baked goods (cakes, cookies, etc.) I also like cooking different things like stews and broths I love to make baked bread. It's probably the most common thing people like to make. A classic for sure! You ever eat fresh baked bread? Yup! I actually used to have one of those bread makers too lol. I haven't eaten as much bread as I used to though. It messes with my diet","It takes some practice to make. Because the heat is quickly transferred from the outside to the inside, it's hard to tell if they are cooked all the way through sometimes.",https://en.wikipedia.org/wiki/Baking
16+
"I like to bake in my spare time. Do you? Yes i love it! Cooking with dry heat in an oven is awesome. What type of things do you like to make? I have a huge sweet tooth so lots of baked goods (cakes, cookies, etc.) I also like cooking different things like stews and broths I love to make baked bread. It's probably the most common thing people like to make. A classic for sure! You ever eat fresh baked bread? Yup! I actually used to have one of those bread makers too lol. I haven't eaten as much bread as I used to though. It messes with my diet","It takes some practice to make. Because the heat slowly is transferred from the inside to the outside, it's hard to tell if they are cooked all the way through sometimes.",https://en.wikipedia.org/wiki/Baking
17+
"I like to bake in my spare time. Do you? Yes i love it! Cooking with dry heat in an oven is awesome. What type of things do you like to make? I have a huge sweet tooth so lots of baked goods (cakes, cookies, etc.) I also like cooking different things like stews and broths I love to make baked bread. It's probably the most common thing people like to make. A classic for sure! You ever eat fresh baked bread? Yup! I actually used to have one of those bread makers too lol. I haven't eaten as much bread as I used to though. It messes with my diet","It takes some practice to make. Because the heat quickly moves from the inside to the outside and back, it's hard to tell if they are cooked all the way through sometimes.",https://en.wikipedia.org/wiki/Baking
18+
"I love Ferrari's. They are probably my favorite Italian car. I love them too. They are sharp. Ferrari's were founded in 1939 by Enzo Ferrari, and the first car arrived in 1940. Wow that is many years ago! I had no idea. What else do you know about Ferrari's? Well in 2014, Brand Finance rated Ferrari as the world's more powerful brand. I didn't know Ferrari's were so powerful!","Yeah in 2012, a 1962 250 GTO became the most epensive car in history when it was sold in a private transaction to Craig McCaw.",https://en.wikipedia.org/wiki/Ferrari
19+
"I love Ferrari's. They are probably my favorite Italian car. I love them too. They are sharp. Ferrari's were founded in 1939 by Enzo Ferrari, and the first car arrived in 1940. Wow that is many years ago! I had no idea. What else do you know about Ferrari's? Well in 2014, Brand Finance rated Ferrari as the world's more powerful brand. I didn't know Ferrari's were so powerful!","Yes, in May 2012, a 1965 Ferrari 250 GTO became the most expensive car ever sold, so they're pretty powerful.",https://en.wikipedia.org/wiki/Ferrari
20+
"I love Ferrari's. They are probably my favorite Italian car. I love them too. They are sharp. Ferrari's were founded in 1939 by Enzo Ferrari, and the first car arrived in 1940. Wow that is many years ago! I had no idea. What else do you know about Ferrari's? Well in 2014, Brand Finance rated Ferrari as the world's more powerful brand. I didn't know Ferrari's were so powerful!",I've read about a lot of people driving Ferraris and nearly crashing them because they're so powerful.,https://en.wikipedia.org/wiki/Ferrari

0 commit comments

Comments
 (0)