Skip to content

Commit 469f878

Browse files
authored
refactor: get_mean_grouping command takes in export_name (#2677)
The `get_mean_grouping_command` currently does not take `export_name` as param. Add the param for better naming use case.
1 parent 31bef43 commit 469f878

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## 0.12.7-dev8
22

3-
### Enhancements
3+
### Enhancements
44

55
* **Add `.metadata.is_continuation` to text-split chunks.** `.metadata.is_continuation=True` is added to second-and-later chunks formed by text-splitting an oversized `Table` element but not to their counterpart `Text` element splits. Add this indicator for `CompositeElement` to allow text-split continuation chunks to be identified for downstream processes that may wish to skip intentionally redundant metadata values in continuation chunks.
66
* **Add `compound_structure_acc` metric to table eval.** Add a new property to `unstructured.metrics.table_eval.TableEvaluation`: `composite_structure_acc`, which is computed from the element level row and column index and content accuracy scores

unstructured/ingest/evaluate.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def main():
4242
help="Directory to save the output evaluation metrics to. Default to \
4343
your/working/dir/metrics/",
4444
)
45-
@click.option("--grouping", type=str, help="Input field for aggregration, or leave blank if none.")
45+
@click.option("--group_by", type=str, help="Input field for aggregration, or leave blank if none.")
4646
@click.option(
4747
"--weights",
4848
type=(int, int, int),
@@ -74,15 +74,15 @@ def measure_text_extraction_accuracy_command(
7474
output_type: str,
7575
output_list: Optional[List[str]] = None,
7676
source_list: Optional[List[str]] = None,
77-
grouping: Optional[str] = None,
77+
group_by: Optional[str] = None,
7878
):
7979
return measure_text_extraction_accuracy(
8080
output_dir,
8181
source_dir,
8282
output_list,
8383
source_list,
8484
export_dir,
85-
grouping,
85+
group_by,
8686
weights,
8787
visualize,
8888
output_type,
@@ -158,8 +158,13 @@ def measure_element_type_accuracy_command(
158158
type=str,
159159
help="Evaluated metric. Expecting one of 'text_extraction' or 'element_type'",
160160
)
161-
def get_mean_grouping_command(group_by: str, data_input: str, export_dir: str, eval_name: str):
162-
return get_mean_grouping(group_by, data_input, export_dir, eval_name)
161+
@click.option(
162+
"--export_name", type=str, help="Optional. Define your file name for the output here."
163+
)
164+
def get_mean_grouping_command(
165+
group_by: str, data_input: str, export_dir: str, eval_name: str, export_name: str
166+
):
167+
return get_mean_grouping(group_by, data_input, export_dir, eval_name, export_name)
163168

164169

165170
@main.command()

0 commit comments

Comments
 (0)