Skip to content

Commit

Permalink
Merge pull request #54 from ArneBinder/re-export-annotations-and-docu…
Browse files Browse the repository at this point in the history
…ments

re-export `annotations` and `documents` from `pytorch_ie`
  • Loading branch information
ArneBinder authored Feb 2, 2024
2 parents 2a4b2ad + 9f2f392 commit 398b433
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 5 deletions.
14 changes: 13 additions & 1 deletion src/pie_modules/annotations.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
import dataclasses
from typing import Optional

from pytorch_ie.annotations import Span
# re-export all annotations from pytorch_ie to have a single entry point
from pytorch_ie.annotations import (
BinaryRelation,
Label,
LabeledMultiSpan,
LabeledSpan,
MultiLabel,
MultiLabeledBinaryRelation,
MultiLabeledMultiSpan,
MultiLabeledSpan,
NaryRelation,
Span,
)
from pytorch_ie.core import Annotation


Expand Down
26 changes: 22 additions & 4 deletions src/pie_modules/documents.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,32 @@
import dataclasses

from pytorch_ie import AnnotationLayer
from pytorch_ie.annotations import BinaryRelation, LabeledSpan
from pytorch_ie.core import AnnotationList, annotation_field
from pytorch_ie.documents import TextBasedDocument, TokenBasedDocument
from pytorch_ie.core import AnnotationLayer, AnnotationList, annotation_field

# re-export all documents from pytorch_ie to have a single entry point
from pytorch_ie.documents import (
TextBasedDocument,
TextDocumentWithLabel,
TextDocumentWithLabeledPartitions,
TextDocumentWithLabeledSpans,
TextDocumentWithLabeledSpansAndBinaryRelations,
TextDocumentWithLabeledSpansAndLabeledPartitions,
TextDocumentWithLabeledSpansAndSentences,
TextDocumentWithLabeledSpansBinaryRelationsAndLabeledPartitions,
TextDocumentWithMultiLabel,
TextDocumentWithSentences,
TextDocumentWithSpans,
TextDocumentWithSpansAndBinaryRelations,
TextDocumentWithSpansAndLabeledPartitions,
TextDocumentWithSpansBinaryRelationsAndLabeledPartitions,
TokenBasedDocument,
)

from pie_modules.annotations import (
AbstractiveSummary,
BinaryRelation,
ExtractiveAnswer,
GenerativeAnswer,
LabeledSpan,
Question,
)

Expand Down

0 comments on commit 398b433

Please sign in to comment.