Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pado
ASYST
Commits
da56a837
Commit
da56a837
authored
Oct 23, 2024
by
Pado
Browse files
Update Source/Skript/german/run_LR_SBERT.py
parent
55c38c34
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/Skript/german/run_LR_SBERT.py
View file @
da56a837
...
@@ -136,7 +136,6 @@ def main():
...
@@ -136,7 +136,6 @@ def main():
# Check if obs_grade contains "NONE" values or is empty
# Check if obs_grade contains "NONE" values or is empty
if
not
obs_grade
or
all
(
grade
==
'NONE'
for
grade
in
obs_grade
):
if
not
obs_grade
or
all
(
grade
==
'NONE'
for
grade
in
obs_grade
):
# print("obs_grade is empty or contains 'NONE' values. Skipping classification report.")
count
+=
1
count
+=
1
else
:
else
:
...
@@ -165,23 +164,6 @@ def main():
...
@@ -165,23 +164,6 @@ def main():
new_wt_avg_line
=
wt_avg_line
.
replace
(
"
\t
"
,
" "
,
1
)
new_wt_avg_line
=
wt_avg_line
.
replace
(
"
\t
"
,
" "
,
1
)
# print(new_wt_avg_line)
# print(new_wt_avg_line)
#
# wt_avg_line = report_lines[7].split()
#
# #wt_avg_line
#
# wg_element_1 = wt_avg_line[0]
# wg_element_2 = wt_avg_line[1]
#
# print(wg_element_1)
# print(wg_element_2)
#
# new_wt_line_out_1_2 =
# formatted_wt_with_tabs = (wt_avg_line[:wt_avg_line.index('\t',
# wt_avg_line.index('\t')) +1 ] + '\t' +
# wt_avg_line[wt_avg_line.index('\t', wt_avg_line.index('\t')):])
# Join the entire newly formatted list into a single string
# Join the entire newly formatted list into a single string
formatted_output
=
"
\n
"
.
join
([
formatted_output
=
"
\n
"
.
join
([
"
\t
precision
\t
recall
\t
f1-score
\t
support"
,
"
\t
precision
\t
recall
\t
f1-score
\t
support"
,
...
@@ -191,10 +173,6 @@ def main():
...
@@ -191,10 +173,6 @@ def main():
new_wt_avg_line
new_wt_avg_line
])
])
# Print the entire formatted output
# print("\nFormatted Output:")
# print(formatted_output)
# UP print results
# UP print results
with
open
(
args
.
output_dir
+
"
\\
predictions.txt"
,
"w"
)
as
writer
:
with
open
(
args
.
output_dir
+
"
\\
predictions.txt"
,
"w"
)
as
writer
:
writer
.
write
(
"question
\t
referenceAnswer
\t
studentAnswer
\t
suggested_grade
\t
observed_grade
\n
"
)
writer
.
write
(
"question
\t
referenceAnswer
\t
studentAnswer
\t
suggested_grade
\t
observed_grade
\n
"
)
...
...
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