Decision ParsingΒΆ

Validate and parse unstructured data by asking a decision model, and judge existing columns with semantic checks. See the decision parsing guide and the tutorial for how to use these objects.

Question TypesΒΆ

A decision model answers typed questions; the question type says what shape the answer has. These are the parser objects passed to ParsedField / ParsedColumn.

Choice

A question that selects one of the column's options.

Score

A question that places the state on the column's ordered scale.

Noul

A yes/no question, answered with a calibrated probability.

Confidence

Reports how certain the model was about another column.

ProvidersΒΆ

DecisionProvider

Something that can answer a set of typed questions about a state.

MockProvider

Answers deterministically from a hash of the state.

RecordingProvider

Wraps a real provider and records every answer to a cassette.

ReplayProvider

Serves answers from a cassette; never touches the network.

ConfigurationΒΆ

set_provider

Set the provider for the current process.

get_provider

Return the active provider, or None if none is configured.

provider

Use a provider for the duration of a block.

register_provider

Make "<prefix>:<model>" resolve to a provider.

capabilities_of

What a provider can be asked; the shared vocabulary if it does not say.

enabled

Whether decision calls are permitted at all.

Semantic ChecksΒΆ

Holds

Check that a statement holds of each row, as judged by a model.

holds

The predicate behind Holds(), for use inside @dataframe_check.

Caching and InspectionΒΆ

MemoryCache

Keeps answers for the lifetime of the process.

SQLiteCache

Keeps answers in a SQLite file, so they survive the process.

Plan

What a validation would send, and roughly what it would cost.

questions

Compile a schema's questions without contacting a provider.

plan

Report what validating data would send, without sending it.

stats

Statistics for the decision work that filled a validated frame.

Types and ErrorsΒΆ

Decision

One answer, normalized across providers.

ProviderCapabilities

What a provider's model can be asked, as opposed to how fast.

ProviderLimits

Throughput limits a provider publishes, used to pace requests.

DecisionsConfigError

Raised when a decision column is validated with no provider set.

ProviderCapabilityError

Raised when a provider's model cannot be asked a schema's question.

Question is a type alias (a union of the three question kinds) rather than an instantiable class; it appears in the signatures of the objects above.