Skip to content

Commit

Permalink
moved evaluation to separate package
Browse files Browse the repository at this point in the history
  • Loading branch information
Rutger Cappendijk committed Nov 24, 2023
1 parent 8a7ed05 commit 9736c8d
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 18 deletions.
24 changes: 12 additions & 12 deletions src/intelligence_layer/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
Language,
)
from .echo import EchoInput, EchoOutput, EchoTask
from .evaluator import Dataset as Dataset
from .evaluator import EvaluationException as EvaluationException
from .evaluator import EvaluationRepository as EvaluationRepository
from .evaluator import EvaluationRunOverview as EvaluationRunOverview
from .evaluator import Evaluator as Evaluator
from .evaluator import Example as Example
from .evaluator import ExampleResult as ExampleResult
from .evaluator import InMemoryEvaluationRepository as InMemoryEvaluationRepository
from .evaluator import LogTrace as LogTrace
from .evaluator import SequenceDataset as SequenceDataset
from .evaluator import SpanTrace as SpanTrace
from .evaluator import TaskSpanTrace as TaskSpanTrace
from .evaluation.evaluator import Dataset as Dataset
from .evaluation.evaluator import EvaluationException as EvaluationException
from .evaluation.evaluator import EvaluationRepository as EvaluationRepository
from .evaluation.evaluator import EvaluationRunOverview as EvaluationRunOverview
from .evaluation.evaluator import Evaluator as Evaluator
from .evaluation.evaluator import Example as Example
from .evaluation.evaluator import ExampleResult as ExampleResult
from .evaluation.evaluator import InMemoryEvaluationRepository as InMemoryEvaluationRepository
from .evaluation.evaluator import LogTrace as LogTrace
from .evaluation.evaluator import SequenceDataset as SequenceDataset
from .evaluation.evaluator import SpanTrace as SpanTrace
from .evaluation.evaluator import TaskSpanTrace as TaskSpanTrace
from .explain import Explain, ExplainInput, ExplainOutput
from .graders import BleuGrader, RougeScores
from .prompt_template import (
Expand Down
Empty file.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/intelligence_layer/use_cases/classify/classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic import BaseModel

from intelligence_layer.core.chunk import Chunk
from intelligence_layer.core.evaluator import EvaluationRepository, Evaluator
from intelligence_layer.core import EvaluationRepository, Evaluator
from intelligence_layer.core.task import Task

Probability = NewType("Probability", float)
Expand Down
2 changes: 1 addition & 1 deletion src/intelligence_layer/use_cases/summarize/summarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from intelligence_layer.core.chunk import Chunk
from intelligence_layer.core.detect_language import Language
from intelligence_layer.core.evaluator import EvaluationRepository, Evaluator
from intelligence_layer.core import EvaluationRepository, Evaluator
from intelligence_layer.core.graders import BleuGrader, RougeGrader
from intelligence_layer.core.task import Task

Expand Down
6 changes: 5 additions & 1 deletion tests/core/test_evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
TaskSpanTrace,
Tracer,
)
from intelligence_layer.core.evaluator import LogTrace, SpanTrace, _to_trace_entry
from intelligence_layer.core import LogTrace, SpanTrace
from intelligence_layer.core.evaluation.evaluator import _to_trace_entry
from intelligence_layer.core.task import Task
from intelligence_layer.core.tracer import InMemorySpan, InMemoryTaskSpan, LogEntry

Expand Down Expand Up @@ -150,6 +151,9 @@ def test_evaluate_dataset_stores_aggregated_results(
assert evaluation_run_overview == loaded_evaluation_run_overview





def test_to_trace_entry() -> None:
now = datetime.utcnow()
entry = _to_trace_entry(
Expand Down
2 changes: 1 addition & 1 deletion tests/use_cases/classify/test_embedding_based_classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
QdrantInMemoryRetriever,
)
from intelligence_layer.core.chunk import Chunk
from intelligence_layer.core.evaluator import InMemoryEvaluationRepository
from intelligence_layer.core import InMemoryEvaluationRepository
from intelligence_layer.core.task import Task
from intelligence_layer.core.tracer import NoOpTracer
from intelligence_layer.use_cases.classify.classify import (
Expand Down
2 changes: 1 addition & 1 deletion tests/use_cases/classify/test_single_label_classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
AlephAlphaClientProtocol,
)
from intelligence_layer.core.chunk import Chunk
from intelligence_layer.core.evaluator import (
from intelligence_layer.core import (
Example,
InMemoryEvaluationRepository,
SequenceDataset,
Expand Down
2 changes: 1 addition & 1 deletion tests/use_cases/summarize/test_summarize.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from intelligence_layer.core.chunk import Chunk
from intelligence_layer.core.detect_language import Language
from intelligence_layer.core.evaluator import (
from intelligence_layer.core import (
Example,
InMemoryEvaluationRepository,
SequenceDataset,
Expand Down

0 comments on commit 9736c8d

Please sign in to comment.