Spaces:
Sleeping
Sleeping
fix columnes name
Browse files
main.py
CHANGED
@@ -155,15 +155,16 @@ async def predict(file: UploadFile = File(...)):
|
|
155 |
sample_name_sentence_similarities,
|
156 |
)
|
157 |
df_predicted = nameMappingHelper.map_standard_names()
|
158 |
-
# Create output dataframe and save to CSV
|
159 |
-
|
160 |
-
|
161 |
-
output_df = inputData.dataframe.copy()
|
162 |
-
print(
|
|
|
|
|
163 |
# Use .loc to avoid SettingWithCopyWarning
|
164 |
-
output_df.loc[:,
|
165 |
output_df.loc[:, "出力_項目名"] = df_predicted["出力_項目名"]
|
166 |
-
output_df.loc[:, "参考_名称"] = df_predicted["参考_名称"]
|
167 |
output_df.loc[:, "出力_確率度"] = df_predicted["出力_確率度"]
|
168 |
|
169 |
# Save with utf_8_sig encoding for Japanese Excel compatibility
|
|
|
155 |
sample_name_sentence_similarities,
|
156 |
)
|
157 |
df_predicted = nameMappingHelper.map_standard_names()
|
158 |
+
# Create output dataframe and save to CSV
|
159 |
+
columns_to_keep = ["ID", "シート名", "行", "科目", "名称", "摘要", "備考"]
|
160 |
+
output_df = inputData.dataframe[columns_to_keep].copy()
|
161 |
+
# output_df = inputData.dataframe.copy()
|
162 |
+
print("Columns of inputData.dataframe", inputData.dataframe.columns)
|
163 |
+
print("Columns of df_predicted", df_predicted.columns)
|
164 |
+
print("Columns of output_df", output_df.columns)
|
165 |
# Use .loc to avoid SettingWithCopyWarning
|
166 |
+
output_df.loc[:, "出力_科目"] = df_predicted["出力_科目"]
|
167 |
output_df.loc[:, "出力_項目名"] = df_predicted["出力_項目名"]
|
|
|
168 |
output_df.loc[:, "出力_確率度"] = df_predicted["出力_確率度"]
|
169 |
|
170 |
# Save with utf_8_sig encoding for Japanese Excel compatibility
|