results
results
¶
Classes:
| Name | Description |
|---|---|
RecordResult |
Represents a NER result for a record in a dataset. |
ExporterConfig |
|
RecordResultExporter |
Responsible for creating a representation of RecordResult that is exportable to |
DatasetClassifyResults |
Represents classification result on the dataset. |
RecordResult(index, entities)
dataclass
¶
Represents a NER result for a record in a dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
index
|
int
|
index of the record in the original dataset |
required |
entities
|
list[Prediction]
|
Dict representation of NERPrediction (NERPrediction.as_dict) |
required |
Source code in src/nemo_safe_synthesizer/pii_replacer/ner/report/results.py
ExporterConfig(include_json_path=False, include_match=False)
dataclass
¶
Attributes:
| Name | Type | Description |
|---|---|---|
include_json_path |
bool
|
If set to True, the exported predictions will include "json_path" field for |
include_match |
bool
|
If set to True, the exported prediction will contain text that got matched. |
include_json_path = field(default=False)
class-attribute
instance-attribute
¶
If set to True, the exported predictions will include "json_path" field for each entity.
include_match = field(default=False)
class-attribute
instance-attribute
¶
If set to True, the exported prediction will contain text that got matched.
RecordResultExporter(config=None)
¶
Responsible for creating a representation of RecordResult that is exportable to the outside.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
Optional[ExporterConfig]
|
Configuration for how to export the predictions. |
None
|
Source code in src/nemo_safe_synthesizer/pii_replacer/ner/report/results.py
DatasetClassifyResults(results=None)
¶
Represents classification result on the dataset.
For now this representation is using whatever is returned from the NER.predict() for simplicity and so we don't need to create a separate data structure (as there may be a lot of results).
Methods:
| Name | Description |
|---|---|
jsonl |
Serializes results into a JSONL-formatted string. |
Source code in src/nemo_safe_synthesizer/pii_replacer/ner/report/results.py
jsonl(exporter_config=None)
¶
Serializes results into a JSONL-formatted string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exporter_config
|
Optional[ExporterConfig]
|
Config to use for the result exporter. |
None
|
JSONL representation of results. Each line contains classification
| Type | Description |
|---|---|
str
|
result for corresponding row in the input dataset. |