add practical error column
This commit is contained in:
parent
d299e68526
commit
faeb1fd7b3
10
main.py
10
main.py
|
@ -472,7 +472,12 @@ def plot2(output_path, normalized_scores, model_scores):
|
||||||
|
|
||||||
|
|
||||||
def plot3(output_path, normalized_scores, model_scores):
|
def plot3(output_path, normalized_scores, model_scores):
|
||||||
data_for_df = {"model": [], "errors": [], "rating_errors": []}
|
data_for_df = {
|
||||||
|
"model": [],
|
||||||
|
"errors": [],
|
||||||
|
"rating_errors": [],
|
||||||
|
"practical_errors": [],
|
||||||
|
}
|
||||||
|
|
||||||
for model in sorted(
|
for model in sorted(
|
||||||
normalized_scores.keys(),
|
normalized_scores.keys(),
|
||||||
|
@ -488,9 +493,11 @@ def plot3(output_path, normalized_scores, model_scores):
|
||||||
for rating in ["general", "sensitive", "questionable", "explicit"]
|
for rating in ["general", "sensitive", "questionable", "explicit"]
|
||||||
if rating in score_data["incorrect_tags"]
|
if rating in score_data["incorrect_tags"]
|
||||||
)
|
)
|
||||||
|
practical_absolute_error = total_incorrect_tags - total_rating_errors
|
||||||
|
|
||||||
data_for_df["errors"].append(total_incorrect_tags)
|
data_for_df["errors"].append(total_incorrect_tags)
|
||||||
data_for_df["rating_errors"].append(total_rating_errors)
|
data_for_df["rating_errors"].append(total_rating_errors)
|
||||||
|
data_for_df["practical_errors"].append(practical_absolute_error)
|
||||||
data_for_df["model"].append(model)
|
data_for_df["model"].append(model)
|
||||||
|
|
||||||
df = pd.DataFrame(data_for_df)
|
df = pd.DataFrame(data_for_df)
|
||||||
|
@ -499,6 +506,7 @@ def plot3(output_path, normalized_scores, model_scores):
|
||||||
data=[
|
data=[
|
||||||
go.Bar(name="incorrect tags", x=df.model, y=df.errors),
|
go.Bar(name="incorrect tags", x=df.model, y=df.errors),
|
||||||
go.Bar(name="incorrect ratings", x=df.model, y=df.rating_errors),
|
go.Bar(name="incorrect ratings", x=df.model, y=df.rating_errors),
|
||||||
|
go.Bar(name="practical error", x=df.model, y=df.practical_errors),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
pio.write_image(fig, output_path, width=1024, height=800)
|
pio.write_image(fig, output_path, width=1024, height=800)
|
||||||
|
|
Loading…
Reference in New Issue