Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
kihoon.lee
dataset
Commits
d6a07b09
Commit
d6a07b09
authored
Aug 07, 2024
by
kihoon.lee
Browse files
add v1.5
parent
ee1f0516
Changes
2
Hide whitespace changes
Inline
Side-by-side
question_recommendation/QR_v1_5.json
0 → 100644
View file @
d6a07b09
This source diff could not be displayed because it is too large. You can
view the blob
instead.
question_recommendation/run_labeling.py
View file @
d6a07b09
...
...
@@ -18,7 +18,7 @@ def chat(question, answer):
"content"
:
(
"현재 대화 주제를 파악한 뒤, 사용자가 AI 어시스턴트에게 질문하면 좋을 것 같은 질의 3가지를 추천합니다."
"출력 형식은 '1.str
\n
2.str
\n
3.str' 이며, 답변 예시는 다음과 같습니다."
"1. 오늘 날씨는 어떤가요?
\n
2. 기분 좋게 하루를 시작하려면 어떤걸 해야할까요?
\n
3. 효과적인 답변을 얻기 위해 제가 어떤 질문을 해야
하나
요?"
"1. 오늘 날씨는 어떤가요?
\n
2. 기분 좋게 하루를 시작하려면 어떤걸 해야할까요?
\n
3. 효과적인 답변을 얻기 위해 제가 어떤 질문을 해야
할까
요?"
),
},
{
...
...
@@ -40,15 +40,20 @@ def add_recommendation(input_file, output_file):
total_entries
=
len
(
data
)
for
i
,
entry
in
enumerate
(
tqdm
(
data
)):
question
=
entry
.
get
(
"질문"
,
""
)
answer
=
entry
.
get
(
"답변"
,
""
)
recommendation
=
chat
(
question
,
answer
)
entry
[
"추천질의"
]
=
recommendation
tqdm
.
write
(
f
"
{
i
+
1
}
/
{
total_entries
}
완료. (
{
(
i
+
1
)
/
total_entries
*
100
:
.
2
f
}
%)"
)
if
i
==
10
:
break
try
:
question
=
entry
.
get
(
"질문"
,
""
)
answer
=
entry
.
get
(
"답변"
,
""
)
recommendation
=
chat
(
question
,
answer
)
entry
[
"추천질의"
]
=
recommendation
tqdm
.
write
(
f
"
{
i
+
1
}
/
{
total_entries
}
완료. (
{
(
i
+
1
)
/
total_entries
*
100
:
.
2
f
}
%)"
)
if
(
i
+
1
)
%
100
==
0
:
with
open
(
output_file
,
"w"
,
encoding
=
"utf-8"
)
as
f
:
json
.
dump
(
data
,
f
,
ensure_ascii
=
False
,
indent
=
4
)
except
Exception
as
e
:
tqdm
.
write
(
f
"오류 발생:
{
e
}
"
)
time
.
sleep
(
10
)
with
open
(
output_file
,
"w"
,
encoding
=
"utf-8"
)
as
f
:
json
.
dump
(
data
,
f
,
ensure_ascii
=
False
,
indent
=
4
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment