Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create separate files for each deduplication class #409

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
57 changes: 37 additions & 20 deletions nemo_curator/modules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,48 +31,65 @@
from .task import TaskDecontamination

# GPU packages
LSH = gpu_only_import_from("nemo_curator.modules.fuzzy_dedup", "LSH")
MinHash = gpu_only_import_from("nemo_curator.modules.fuzzy_dedup", "MinHash")
FuzzyDuplicates = gpu_only_import_from(
"nemo_curator.modules.fuzzy_dedup", "FuzzyDuplicates"
MinHash = gpu_only_import_from("nemo_curator.modules.fuzzy_dedup.minhash", "MinHash")
LSH = gpu_only_import_from("nemo_curator.modules.fuzzy_dedup.lsh", "LSH")
_MapBuckets = gpu_only_import_from(
"nemo_curator.modules.fuzzy_dedup._mapbuckets", "_MapBuckets"
)
_Shuffle = gpu_only_import_from("nemo_curator.modules.fuzzy_dedup._shuffle", "_Shuffle")
sarahyurick marked this conversation as resolved.
Show resolved Hide resolved
JaccardSimilarity = gpu_only_import_from(
"nemo_curator.modules.fuzzy_dedup.jaccardsimilarity", "JaccardSimilarity"
)
BucketsToEdges = gpu_only_import_from(
"nemo_curator.modules.fuzzy_dedup", "BucketsToEdges"
"nemo_curator.modules.fuzzy_dedup.bucketstoedges", "BucketsToEdges"
)
ConnectedComponents = gpu_only_import_from(
"nemo_curator.modules.fuzzy_dedup.connectedcomponents", "ConnectedComponents"
)
FuzzyDuplicates = gpu_only_import_from(
"nemo_curator.modules.fuzzy_dedup.fuzzyduplicates", "FuzzyDuplicates"
)
# Pytorch related imports must come after all imports that require cugraph,
# because of context cleanup issues b/w pytorch and cugraph
# See this issue: https://github.com/rapidsai/cugraph/issues/2718
SemDedup = gpu_only_import_from("nemo_curator.modules.semantic_dedup", "SemDedup")
EmbeddingCreator = gpu_only_import_from(
"nemo_curator.modules.semantic_dedup", "EmbeddingCreator"
"nemo_curator.modules.semantic_dedup.embeddings", "EmbeddingCreator"
)
ClusteringModel = gpu_only_import_from(
"nemo_curator.modules.semantic_dedup", "ClusteringModel"
"nemo_curator.modules.semantic_dedup.clusteringmodel", "ClusteringModel"
)
SemanticClusterLevelDedup = gpu_only_import_from(
"nemo_curator.modules.semantic_dedup", "SemanticClusterLevelDedup"
"nemo_curator.modules.semantic_dedup.semanticclusterleveldedup",
"SemanticClusterLevelDedup",
)
SemDedup = gpu_only_import_from(
"nemo_curator.modules.semantic_dedup.semdedup", "SemDedup"
)

__all__ = [
"AddId",
"FuzzyDuplicatesConfig",
"SemDedupConfig",
"blend_datasets",
"Shuffle",
"ExactDuplicates",
"Filter",
"FuzzyDuplicatesConfig",
"FuzzyDuplicates",
"BucketsToEdges",
"LSH",
"MinHash",
"Modify",
"Score",
"ScoreFilter",
"ParallelScoreFilter",
"Sequential",
"Modify",
"TaskDecontamination",
"AddId",
"blend_datasets",
"Shuffle",
"SemDedup",
"SemDedupConfig",
"MinHash",
"LSH",
"_MapBuckets",
"_Shuffle",
"JaccardSimilarity",
"BucketsToEdges",
"ConnectedComponents",
"FuzzyDuplicates",
"EmbeddingCreator",
"ClusteringModel",
"SemanticClusterLevelDedup",
"SemDedup",
]
Loading
Loading