repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
omkarcloud/botasaurus | https://github.com/omkarcloud/botasaurus | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | botasaurus/request_decorator.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:08.861807 | from functools import wraps
from traceback import print_exc, format_exc
from datetime import timedelta
from typing import Any, Callable, Optional, Union, List
from .utils import is_errors_instance, NotFoundException
from .create_request import create_request
from .beep_utils import beep_input
from .list_utils im... |
omkarcloud/botasaurus | https://github.com/omkarcloud/botasaurus | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | botasaurus/soupify.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:09.247276 | from bs4 import BeautifulSoup
def soupify(item) -> BeautifulSoup:
if isinstance(item, str):
return BeautifulSoup(item, "html.parser")
elif isinstance(item, BeautifulSoup):
return item
# Driver
elif hasattr(item, "page_html"):
return BeautifulSoup(item.page_html, "ht... |
omkarcloud/botasaurus | https://github.com/omkarcloud/botasaurus | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | botasaurus/string_utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:09.361107 |
def applyTransformer(data, transformer):
"""
Apply a transformer function to all strings in a nested data structure.
:param data: The data structure (dict, list, nested dicts) to transform.
:param transformer: A function that takes a string and returns a transformed string.
:return: The t... |
omkarcloud/botasaurus | https://github.com/omkarcloud/botasaurus | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | botasaurus/task_decorator.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:09.445221 | from functools import wraps
from traceback import print_exc, format_exc
from datetime import timedelta
from typing import Any, Callable, Optional, Union, List
from .utils import is_errors_instance, NotFoundException
from .beep_utils import beep_input
from .list_utils import flatten
from botasaurus.decorators_c... |
omkarcloud/botasaurus | https://github.com/omkarcloud/botasaurus | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | botasaurus_api/botasaurus_api/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:09.475629 | import requests
from requests.exceptions import ConnectionError
from .utils import get_filename_from_response_headers, write_json_response, write_file_response, remove_after_first_slash
from typing import Optional
class ApiException(Exception):
pass
def _create_filename(path):
return "output/respons... |
omkarcloud/botasaurus | https://github.com/omkarcloud/botasaurus | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | botasaurus/thread_with_result.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:09.476236 | from threading import Thread
class ThreadWithResult(Thread):
def __init__(
self, group=None, target=None, name=None, args=(), kwargs={}, *, daemon=None
):
self.result = None
self._exception = None
def function():
try:
self.result = target(... |
omkarcloud/botasaurus | https://github.com/omkarcloud/botasaurus | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | botasaurus/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:09.510595 | import json
import os
class NotFoundException(Exception):
def __init__(self, link=None, raise_maximum_1_time=True):
self.link = link
self.raised_once = False
self.raise_maximum_1_time = raise_maximum_1_time
if link:
message = f"Not found for link: {link}"
... |
omkarcloud/botasaurus | https://github.com/omkarcloud/botasaurus | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | botasaurus_api/botasaurus_api/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:09.547200 | import json
from os import path, makedirs, getcwd
def remove_after_first_slash(input_string):
i = 0
str_len = len(input_string)
while True:
if i < str_len:
char = input_string[i]
if char == "/":
if i+1 < len(input_string) and input_string[i+1] == "... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/_typing.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:13.285921 | import os
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
FrozenSet,
Iterable,
Iterator,
List,
Literal,
Mapping,
MutableSequence,
Protocol,
Sequence,
Tuple,
Type,
TypedDict,
Union,
runtime_checkable,
)
import numpy
import numpy.typing
if... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | benchmarks/benchmarks/common.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:13.286760 | import csv
import logging
import optparse
import re
from dataclasses import dataclass
from itertools import groupby
from pathlib import Path
DATASETS_DIR = Path(__file__).parent / "datasets"
def pre_process(column):
column = re.sub(" +", " ", column)
column = re.sub("\n", " ", column)
column = column.st... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | benchmarks/benchmarks/canonical_matching.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:13.287859 | import io
import os
import time
import dedupe
from benchmarks import common
def get_true_dupes(data):
data_1, data_2 = data
all_data = data_1.copy()
all_data.update(data_2)
return common.get_true_dupes(all_data)
def make_report(data, clustering):
true_dupes = get_true_dupes(data)
predicted_... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | benchmarks/benchmarks/canonical.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:13.290503 | import io
import os
import time
from itertools import combinations
import dedupe
from benchmarks import common
def make_report(data, clustering):
true_dupes = common.get_true_dupes(data)
predicted_dupes = set()
for cluser_id, _ in clustering:
for pair in combinations(cluser_id, 2):
pr... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | benchmarks/benchmarks/canonical_gazetteer.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:13.293046 | import os
import time
import dedupe
from benchmarks import canonical_matching, common
def make_report(data, clustering):
true_dupes = canonical_matching.get_true_dupes(data)
predicted_dupes = {
frozenset([a, b]) for a, result in clustering for b, score in result
}
return common.Report.from_sc... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | benchmarks/setup.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:13.293880 | # Dummy file to allow editable installs
from setuptools import find_packages, setup
if __name__ == "__main__":
setup(
name="benchmarks",
packages=find_packages(),
package_data={
# If any package contains *.txt or *.json files, include them:
"": ["*.csv"],
... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | .github/scripts/asv_markdown.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:13.294837 | import re
def format(element):
if is_float(element):
f = float(element)
return "{0:.3}".format(f)
else:
return element
def is_float(element):
try:
float(element)
except ValueError:
return False
else:
return True
def to_markdown(data):
pream... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:13.296056 | from dedupe.api import ( # noqa: F401
Dedupe,
Gazetteer,
RecordLink,
StaticDedupe,
StaticGazetteer,
StaticRecordLink,
)
from dedupe.convenience import ( # noqa: F401
canonicalize,
console_label,
training_data_dedupe,
training_data_link,
)
from dedupe.serializer import read_trai... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/api.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:13.322338 | #!/usr/bin/python
"""
dedupe provides the main user interface for the library the
Dedupe class
"""
from __future__ import annotations
import itertools
import logging
import multiprocessing
import os
import pickle
import sqlite3
import tempfile
import warnings
from typing import TYPE_CHECKING, Literal, cast, overload
... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/canonical.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:15.642740 | from typing import Mapping, Sequence
import numpy
import numpy.typing
from affinegap import normalizedAffineGapDistance as affine
from dedupe._typing import Comparator, RecordDict
def getCentroid(attribute_variants: Sequence[str], comparator: Comparator) -> str:
"""
Takes in a list of attribute values for a... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/branch_and_bound.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:15.644160 | from __future__ import annotations
import functools
from typing import Any, Collection, Iterable, Mapping, Tuple
from ._typing import Cover
from .predicates import Predicate
Partial = Tuple[Predicate, ...]
def _reachable(dupe_cover: Mapping[Any, frozenset[int]]) -> int:
return len(frozenset.union(*dupe_cover.v... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/backport.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:15.645436 | import platform
if platform.system() == "Darwin":
import multiprocessing
ctx = multiprocessing.get_context("spawn")
Queue = ctx.Queue
Process = ctx.Process
Pool = ctx.Pool
SimpleQueue = ctx.SimpleQueue
Lock = ctx.Lock
RLock = ctx.RLock
else:
from multiprocessing import ( # type: i... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/convenience.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:15.646518 | #!/usr/bin/python
from __future__ import annotations
import collections
import itertools
import random
import sys
import warnings
from typing import Iterator, Literal, Tuple, overload
import numpy
import dedupe
from dedupe._typing import (
DataInt,
DataStr,
RecordDict,
RecordDictPair,
RecordID,
... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/clustering.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:15.647498 | #!/usr/bin/python
from __future__ import annotations
import array
import itertools
import logging
import tempfile
from collections import defaultdict
from typing import Generator, Iterable, Sequence, cast
import numpy
import numpy.typing
import scipy.cluster.hierarchy
from dedupe._typing import ArrayLinks, Clusters,... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/blocking.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:15.648631 | #!/usr/bin/python
from __future__ import annotations
import logging
import time
from collections import defaultdict
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import (
Any,
Callable,
DefaultDict,
Generator,
Iterable,
List,
Sequence,
... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/index.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:16.708982 | from __future__ import annotations
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import MutableMapping, Tuple
Doc = Tuple[str, ...]
class Index(ABC):
_doc_to_id: MutableMapping[Doc, int]
@abstractmethod
def __init__(self) -> None: # pragma:... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/canopy_index.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:17.093996 | from __future__ import annotations
import logging
import math
from typing import Iterable
import numpy
from BTrees.Length import Length
from zope.index.text.cosineindex import CosineIndex
from zope.index.text.lexicon import Lexicon
from zope.index.text.setops import mass_weightedUnion
from zope.index.text.textindex i... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/datamodel.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:17.206038 | from __future__ import annotations
import copyreg
import types
from collections.abc import Mapping
from typing import TYPE_CHECKING, cast
import numpy
from dedupe._typing import FieldVariable
from dedupe.variables.interaction import InteractionType
if TYPE_CHECKING:
from typing import Collection, Generator, Ite... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/core.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:17.207464 | #!/usr/bin/python
from __future__ import annotations
import collections
import functools
import itertools
import multiprocessing
import multiprocessing.dummy
import os
import queue
import tempfile
from typing import TYPE_CHECKING, overload
import numpy
from dedupe.backport import RLock
if TYPE_CHECKING:
from ty... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/serializer.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:17.450789 | import json
from typing import Any, Iterator, TextIO
from dedupe._typing import TrainingData
def _from_json(json_object: Any) -> Any:
if "__class__" in json_object:
if json_object["__class__"] == "frozenset":
return frozenset(json_object["__value__"])
if json_object["__class__"] == "t... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/predicates.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:17.468808 | #!/usr/bin/python
from __future__ import annotations
import abc
import re
import string
from itertools import product
from typing import TYPE_CHECKING
import dedupe.levenshtein as levenshtein
import dedupe.tfidf as tfidf
from dedupe.cpredicates import ngrams
# This allows to import predicate functions from this modu... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/predicate_functions.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:17.470270 | import re
from itertools import chain
from math import copysign, floor, log10
from typing import Any, FrozenSet, Sequence, Tuple, Union
from doublemetaphone import doublemetaphone
# This allows to import all cpredicate functions from this module.
from dedupe.cpredicates import initials, ngrams, unique_ngrams # noqa:... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/levenshtein.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:17.479392 | from typing import Dict, List
import Levenshtein_search
from .core import Enumerator
from .index import Index
class LevenshteinIndex(Index):
_doc_to_id: Dict[str, int] # type: ignore[assignment]
def __init__(self) -> None:
self.index_key = Levenshtein_search.populate_wordset(-1, [])
self._... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/labeler.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:17.480631 | from __future__ import annotations
import logging
import random
from abc import ABC, abstractmethod
from typing import TYPE_CHECKING, overload
from warnings import warn
import numpy
import numpy.typing
import sklearn.linear_model
import dedupe.core as core
import dedupe.training as training
if TYPE_CHECKING:
fr... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/tfidf.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:17.497835 | #!/usr/bin/python
import logging
from typing import List, Tuple
from dedupe.canopy_index import CanopyIndex
from dedupe.core import Enumerator
from dedupe.index import Index
logger = logging.getLogger(__name__)
Doc = Tuple[str, ...]
class TfIdfIndex(Index):
def __init__(self) -> None:
self._index = Can... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/training.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:17.547409 | from __future__ import annotations
import collections
import functools
import itertools
import logging
import math
import random
from abc import ABC
from typing import TYPE_CHECKING, overload
from warnings import warn
from . import blocking, branch_and_bound
if TYPE_CHECKING:
from typing import Iterable, Literal... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/variables/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:17.694894 | from .base import CustomType as Custom
from .categorical_type import CategoricalType as Categorical
from .exact import ExactType as Exact
from .exists import ExistsType as Exists
from .interaction import InteractionType as Interaction
from .latlong import LatLongType as LatLong
from .price import PriceType as Price
fro... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/variables/categorical_type.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:17.772240 | from __future__ import annotations
from typing import Sequence
from categorical import CategoricalComparator
from dedupe import predicates
from dedupe._typing import PredicateFunction
from dedupe.variables.base import DerivedType, FieldType
class CategoricalType(FieldType):
type = "Categorical"
_predicate_... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/variables/base.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:17.807098 | from __future__ import annotations
from typing import TYPE_CHECKING
from dedupe import predicates
if TYPE_CHECKING:
from typing import Any, ClassVar, Iterable, Sequence
from dedupe._typing import Comparator, CustomComparator, PredicateFunction
from dedupe._typing import Variable as VariableProtocol
cl... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/variables/exact.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:18.204252 | from typing import Any
from dedupe import predicates
from dedupe.variables.base import FieldType
class ExactType(FieldType):
_predicate_functions = [predicates.wholeFieldPredicate]
type = "Exact"
@staticmethod
def comparator(field_1: Any, field_2: Any) -> int:
if field_1 == field_2:
... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/variables/price.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:18.293853 | from __future__ import annotations
import numpy
from dedupe import predicates
from dedupe.variables.base import FieldType
class PriceType(FieldType):
_predicate_functions = [
predicates.orderOfMagnitude,
predicates.wholeFieldPredicate,
predicates.roundTo1,
]
type = "Price"
@... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/variables/latlong.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:18.301211 | from __future__ import annotations
from math import sqrt
from haversine import haversine
from dedupe import predicates
from dedupe.variables.base import FieldType
class LatLongType(FieldType):
type = "LatLong"
_predicate_functions = [predicates.latLongGridPredicate]
@staticmethod
def comparator(x... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/variables/exists.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:18.302778 | from __future__ import annotations
from typing import Any
from categorical import CategoricalComparator
from dedupe._typing import PredicateFunction
from dedupe.variables.base import DerivedType, FieldType
class ExistsType(FieldType):
type = "Exists"
_predicate_functions: list[PredicateFunction] = []
... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/variables/interaction.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:18.494765 | from __future__ import annotations
import itertools
from typing import Mapping
from dedupe._typing import FieldVariable, InteractionVariable
from dedupe.variables.base import Variable
class InteractionType(Variable):
type = "Interaction"
higher_vars: list[InteractionVariable]
def __init__(self, *args: ... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/variables/string.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:18.513622 | from typing import Iterable, Optional, Sequence, Type
from affinegap import normalizedAffineGapDistance as affineGap
from highered import CRFEditDistance
from simplecosine.cosine import CosineTextSimilarity
from dedupe import predicates
from dedupe._typing import PredicateFunction
from dedupe.variables.base import Fi... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:18.577830 | try:
from setuptools import Extension, setup
except ImportError:
raise ImportError(
"setuptools module required, please go to https://pypi.python.org/pypi/setuptools and follow the instructions for installing setuptools"
)
from Cython.Build import cythonize
setup(
ext_modules=cythonize([Extens... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | tests/test_api.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:18.778731 | import itertools
import unittest
import warnings
from collections import OrderedDict
import dedupe.api
def icfi(x):
return list(itertools.chain.from_iterable(x))
DATA_SAMPLE = [
({"age": "27", "name": "Kyle"}, {"age": "50", "name": "Bob"}),
({"age": "27", "name": "Kyle"}, {"age": "35", "name": "William... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | dedupe/variables/set.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:19.146598 | from typing import Collection, Iterable, Optional
from simplecosine.cosine import CosineSetSimilarity
from dedupe import predicates
from dedupe.variables.base import FieldType
class SetType(FieldType):
type = "Set"
_predicate_functions = (
predicates.wholeSetPredicate,
predicates.commonSetE... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | tests/test_blocking.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:19.159670 | import unittest
from collections import defaultdict
import dedupe
class BlockingTest(unittest.TestCase):
def setUp(self):
field_definition = [{"field": "name", "type": "String"}]
self.data_model = dedupe.Dedupe(field_definition).data_model
self.training_pairs = {
"match": [
... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | tests/test_core.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:19.259237 | import random
import unittest
import numpy
import scipy.special
import dedupe
class MockClassifier:
def __init__(self):
self.weight = 0
self.bias = 0
def predict_proba(self, examples):
return scipy.special.expit(examples * self.weight + self.bias)
class ScoreDuplicates(unittest.Te... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | tests/test_canonical.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:19.285214 | import unittest
import dedupe.canonical
class CanonicalizationTest(unittest.TestCase):
def test_get_centroid(self):
from affinegap import normalizedAffineGapDistance as comparator
attributeList = [
"mary crane center",
"mary crane center north",
"mary crane le... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | tests/test_cpredicates.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:19.314366 | import unittest
from dedupe.cpredicates import initials, ngrams, unique_ngrams
class TestCPredicates(unittest.TestCase):
def test_ngrams(self):
assert ngrams("deduplicate", 1) == [
"d",
"e",
"d",
"u",
"p",
"l",
"i",
... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | tests/test_predicate_functions.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:19.710760 | import unittest
from dedupe import predicate_functions as fn
from dedupe.cpredicates import ngrams
class TestPredicateFunctions(unittest.TestCase):
def test_whole_field_predicate(self):
assert fn.wholeFieldPredicate("donald") == {"donald"}
assert fn.wholeFieldPredicate("go-of,y ") == {"go-of,y ... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | tests/test_predicates.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:19.718423 | import unittest
from dedupe import predicates
class TestPuncStrip(unittest.TestCase):
def test_sevenchar(self):
s1 = predicates.StringPredicate(predicates.sameSevenCharStartPredicate, "foo")
assert s1({"foo": "fo,18v*1vaad80"}) == s1({"foo": "fo18v1vaad80"})
def test_set(self):
s1 = ... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | tests/test_exists.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:20.259874 | import unittest
import numpy
from dedupe.variables.exists import ExistsType
class TestExists(unittest.TestCase):
def test_comparator(self):
var = ExistsType("foo")
assert numpy.array_equal(var.comparator(None, None), [0, 0])
assert numpy.array_equal(var.comparator(1, 1), [1, 0])
... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | tests/test_dedupe.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:20.435189 | import itertools
import unittest
import numpy
import dedupe
import dedupe.variables
DATA = {
100: {"name": "Bob", "age": "50"},
105: {"name": "Charlie", "age": "75"},
110: {"name": "Meredith", "age": "40"},
115: {"name": "Sue", "age": "10"},
120: {"name": "Jimmy", "age": "20"},
125: {"name": ... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | tests/duplicateCluster_memory_case.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:23.633439 | import random
import dedupe.core
import dedupe.dedupe # noqa: F401
# simulated_candidates = (((1, {'name': 'asdffdsa'}), (2, {'name': 'fdsaasdf'}))
# for _ in xrange(10**6))
# data_model = {"fields": {"name": {"type": "String", "weight": -1.0}},
# "bias": 1.0}
# threshold = 0
# dupes = dedupe.core.scoreDuplicates... |
dedupeio/dedupe | https://github.com/dedupeio/dedupe | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | tests/test_labeler.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:24.537634 | import random
import unittest
import pytest
import dedupe
from dedupe import datamodel, labeler
from dedupe._typing import RecordDictPair
SAMPLE = {
1: {"name": "Meredith", "age": "40"},
2: {"name": "Sue", "age": "10"},
3: {"name": "Willy", "age": "35"},
4: {"name": "William", "age": "35"},
5: {"... |
Lxtharia/minegrub-theme | https://github.com/Lxtharia/minegrub-theme | null | null | null | null | 4,461 | null | null | mit | null | null | null | null | null | null | null | minegrub/update_theme.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:30.784679 | #!/usr/bin/env python3
"""MIT License, see LICENSE for more details."""
import os
import random
import shutil
import subprocess
import sys
from os.path import abspath, dirname
from pathlib import Path
from PIL import Image, ImageDraw, ImageFont
import hashlib
def update_splash(slogan: str) -> None:
# Choose rand... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | example/train_supervised_cnn.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:33.569788 | # coding:utf-8
import torch
import numpy as np
import json
import opennre
from opennre import encoder, model, framework
import sys
import os
import argparse
import logging
import random
def set_seed(seed):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | example/train_supervised_bert.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:33.577534 | # coding:utf-8
import torch
import numpy as np
import json
import opennre
from opennre import encoder, model, framework
import sys
import os
import argparse
import logging
import random
def set_seed(seed):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | example/train_bag_cnn.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:33.578453 | # coding:utf-8
import sys, json
import torch
import os
import numpy as np
import opennre
import argparse
import logging
import random
def set_seed(seed):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
parser = argparse.ArgumentParser()
parser.add_argume... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | example/train_bag_bert.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:33.580274 | # coding:utf-8
import sys, json
import torch
import os
import numpy as np
import opennre
import argparse
import logging
import random
def set_seed(seed):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
parser = argparse.ArgumentParser()
parser.add_argume... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/encoder/bert_encoder.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:33.583415 | import logging
import torch
import torch.nn as nn
from transformers import BertModel, BertTokenizer
from .base_encoder import BaseEncoder
class BERTEncoder(nn.Module):
def __init__(self, max_length, pretrain_path, blank_padding=True, mask_entity=False):
"""
Args:
max_length: m... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | example/test_multilabel_cnn.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:33.585071 | # coding:utf-8
import torch
import numpy as np
import json
import opennre
from opennre import encoder, model, framework
import sys
import os
import argparse
import logging
parser = argparse.ArgumentParser()
parser.add_argument('--ckpt', default='',
help='Checkpoint name')
parser.add_argument('--only_test', ac... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | example/test_multilabel_bert.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:33.586263 | # coding:utf-8
import torch
import numpy as np
import json
import opennre
from opennre import encoder, model, framework
import sys
import os
import argparse
import logging
import random
def set_seed(seed):
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/encoder/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:33.588014 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .cnn_encoder import CNNEncoder
from .pcnn_encoder import PCNNEncoder
from .bert_encoder import BERTEncoder, BERTEntityEncoder
__all__ = [
'CNNEncoder',
'PCNNEncoder',
'BERTEncoder',
'BERTE... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/encoder/base_encoder.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:33.611751 | import math, logging
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from ..tokenization import WordTokenizer
class BaseEncoder(nn.Module):
def __init__(self,
token2id,
max_length=128,
hidden_size=230,
wo... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:33.613241 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .pretrain import check_root, get_model, download, download_pretrain
import logging
import os
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=os.environ.get("LOGLE... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/encoder/cnn_encoder.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.161075 | import torch
import torch.nn as nn
import torch.nn.functional as F
from ..module.nn import CNN
from ..module.pool import MaxPool
from .base_encoder import BaseEncoder
class CNNEncoder(BaseEncoder):
def __init__(self,
token2id,
max_length=128,
hidden_size=230,... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/encoder/pcnn_encoder.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.217272 | import torch
import torch.nn as nn
import torch.nn.functional as F
from ..module.nn import CNN
from ..module.pool import MaxPool
from .base_encoder import BaseEncoder
from nltk import word_tokenize
class PCNNEncoder(BaseEncoder):
def __init__(self,
token2id,
max_length=128,
... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/framework/bag_re.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.221107 | import torch
from torch import nn, optim
import json
from .data_loader import SentenceRELoader, BagRELoader
from .utils import AverageMeter
from tqdm import tqdm
import os
class BagRE(nn.Module):
def __init__(self,
model,
train_path,
val_path,
... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/model/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.242764 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .base_model import SentenceRE, BagRE, FewShotRE, NER
from .softmax_nn import SoftmaxNN
from .sigmoid_nn import SigmoidNN
from .bag_attention import BagAttention
from .bag_average import BagAverage
from .ba... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/framework/data_loader.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.244227 | import torch
import torch.utils.data as data
import os, random, json, logging
import numpy as np
import sklearn.metrics
class SentenceREDataset(data.Dataset):
"""
Sentence-level relation extraction dataset
"""
def __init__(self, path, rel2id, tokenizer, kwargs):
"""
Args:
pa... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/framework/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.246594 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .data_loader import SentenceREDataset, SentenceRELoader, BagREDataset, BagRELoader, MultiLabelSentenceREDataset, MultiLabelSentenceRELoader
from .sentence_re import SentenceRE
from .bag_re import BagRE
fro... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/framework/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.247787 | class AverageMeter(object):
"""
Computes and stores the average and current value of metrics.
"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
def update(self, val, n=0):
self.val = val
... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/framework/multi_label_sentence_re.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.251928 | import os, logging, json
from tqdm import tqdm
import torch
from torch import nn, optim
from .data_loader import MultiLabelSentenceRELoader
from .utils import AverageMeter
import numpy as np
class MultiLabelSentenceRE(nn.Module):
def __init__(self,
model,
train_path,
... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/framework/sentence_re.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.252978 | import os, logging, json
from tqdm import tqdm
import torch
from torch import nn, optim
from .data_loader import SentenceRELoader
from .utils import AverageMeter
class SentenceRE(nn.Module):
def __init__(self,
model,
train_path,
val_path,
test... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/model/bag_attention.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.254597 | import torch
from torch import nn, optim
from .base_model import BagRE
class BagAttention(BagRE):
"""
Instance attention for bag-level relation extraction.
"""
def __init__(self, sentence_encoder, num_class, rel2id, use_diag=True):
"""
Args:
sentence_encoder: encoder for se... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/model/bag_average.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.849031 | import torch
from torch import nn, optim
from .base_model import BagRE
class BagAverage(BagRE):
"""
Average policy for bag-level relation extraction.
"""
def __init__(self, sentence_encoder, num_class, rel2id):
"""
Args:
sentence_encoder: encoder for sentences
n... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/model/bag_one.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.879814 | import torch
from torch import nn, optim
from .base_model import BagRE
class BagOne(BagRE):
"""
Instance one(max) for bag-level relation extraction.
"""
def __init__(self, sentence_encoder, num_class, rel2id):
"""
Args:
sentence_encoder: encoder for sentences
nu... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/model/base_model.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.892411 | import torch
from torch import nn
import json
class SentenceRE(nn.Module):
def __init__(self):
super().__init__()
def infer(self, item):
"""
Args:
item: {'text' or 'token', 'h': {'pos': [start, end]}, 't': ...}
Return:
(Name of the relation of the se... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/model/softmax_nn.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.900425 | import torch
from torch import nn, optim
from .base_model import SentenceRE
class SoftmaxNN(SentenceRE):
"""
Softmax classifier for sentence-level relation extraction.
"""
def __init__(self, sentence_encoder, num_class, rel2id):
"""
Args:
sentence_encoder: encoder for sente... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/module/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.901398 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
|
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/model/sigmoid_nn.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.912760 | import torch
from torch import nn, optim
from .base_model import SentenceRE
class SigmoidNN(SentenceRE):
"""
Sigmoid (binary) classifier for sentence-level relation extraction.
"""
def __init__(self, sentence_encoder, num_class, rel2id):
"""
Args:
sentence_encoder: encoder ... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/module/nn/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.914058 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .cnn import CNN
from .rnn import RNN
from .lstm import LSTM
__all__ = [
'CNN',
'RNN',
'LSTM',
] |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/module/nn/lstm.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.942277 | import torch
import torch.nn as nn
class LSTM(nn.Module):
def __init__(self, input_size=50, hidden_size=256, dropout=0, bidirectional=False, num_layers=1, activation_function="tanh"):
"""
Args:
input_size: dimention of input embedding
hidden_size: hidden size
dr... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/module/nn/rnn.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.943781 | import torch
import torch.nn as nn
class RNN(nn.Module):
def __init__(self, input_size=50, hidden_size=256, dropout=0, bidirectional=False, num_layers=1, activation_function="tanh"):
"""
Args:
input_size: dimention of input embedding
hidden_size: hidden size
dro... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/module/nn/cnn.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:34.962937 | import torch
import torch.nn as nn
import torch.nn.functional as F
class CNN(nn.Module):
def __init__(self, input_size=50, hidden_size=256, dropout=0, kernel_size=3, padding=1, activation_function=F.relu):
"""
Args:
input_size: dimention of input embedding
kernel_size: kern... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/module/pool/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:35.781943 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .max_pool import MaxPool
from .avg_pool import AvgPool
__all__ = [
'MaxPool',
'AvgPool'
] |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/tokenization/word_piece_tokenizer.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:35.963997 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/tokenization/utils.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:35.965064 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import unicodedata
import six
def is_whitespace(char):
""" Checks whether `chars` is a whitespace character.
\t, \n, and \r are technically contorl characters but we treat the... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/pretrain.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:35.976303 | from . import encoder
from . import model
from . import framework
import torch
import os
import sys
import json
import numpy as np
import logging
root_url = "https://thunlp.oss-cn-qingdao.aliyuncs.com/"
default_root_path = os.path.join(os.getenv('HOME'), '.opennre')
def check_root(root_path=default_root_path):
if... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/tokenization/word_tokenizer.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:35.976837 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/tokenization/bert_tokenizer.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:36.021247 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:36.780218 | import setuptools
with open("README.md", "r") as fh:
setuptools.setup(
name='open-nre',
version='0.1.1',
author="Tianyu Gao",
author_email="gaotianyu1350@126.com",
description="An open source toolkit for relation extraction",
url="https://github.com/thunlp/opennre",... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/tokenization/basic_tokenizer.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:36.952707 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/module/pool/avg_pool.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:36.953336 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
class AvgPool(nn.Module):
def __init__(self, kernel_size, segment_num=None):
"""
Args:
input_size: dimention of input embedding
kernel_size: kernel_size for CNN
padding: paddin... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/tokenization/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:36.997446 | # coding=utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .basic_tokenizer import BasicTokenizer
from .word_piece_tokenizer import WordpieceTokenizer
from .word_tokenizer import WordTokenizer
from .bert_tokenizer import BertTokenizer
__all__ = [
... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | opennre/module/pool/max_pool.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:37.065754 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
class MaxPool(nn.Module):
def __init__(self, kernel_size, segment_num=None):
"""
Args:
input_size: dimention of input embedding
kernel_size: kernel_size for CNN
padding: paddin... |
thunlp/OpenNRE | https://github.com/thunlp/OpenNRE | null | null | null | null | 4,457 | null | null | mit | null | null | null | null | null | null | null | tests/test_inference.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:41.741504 | import unittest
import opennre
class TestInference(unittest.TestCase):
def test_wiki80_cnn_softmax(self):
model = opennre.get_model('wiki80_cnn_softmax')
result = model.infer({'text': 'He was the son of Máel Dúin mac Máele Fithrich, and grandson of the high king Áed Uaridnach (died 612).', 'h': {'... |
yihong0618/running_page | https://github.com/yihong0618/running_page | null | null | null | null | 4,444 | null | null | mit | null | null | null | null | null | null | null | run_page/fit_sync.py | null | null | null | null | null | null | Python | 2026-05-04T02:00:43.995465 | """
If you do not want bind any account
Only the gpx files in GPX_OUT sync
"""
from config import JSON_FILE, SQL_FILE, FIT_FOLDER
from utils import make_activities_file
if __name__ == "__main__":
print("only sync fit files in FIT_OUT")
make_activities_file(SQL_FILE, FIT_FOLDER, JSON_FILE, "fit")
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.