From 124929812b19730ad61fb30aa29237fbd850e2e2 Mon Sep 17 00:00:00 2001 From: Jael Gu Date: Thu, 31 Mar 2022 11:35:31 +0800 Subject: [PATCH] Add init Signed-off-by: Jael Gu --- __init__.py | 19 +++++++++++++++++++ nlp_dpr.py => dpr.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 __init__.py rename nlp_dpr.py => dpr.py (98%) diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e6b9968 --- /dev/null +++ b/__init__.py @@ -0,0 +1,19 @@ +# Copyright 2021 Zilliz. All rights reserved. +# +# 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 applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from .dpr import Dpr + + +def dpr(model_name: str): + return Dpr(model_name) diff --git a/nlp_dpr.py b/dpr.py similarity index 98% rename from nlp_dpr.py rename to dpr.py index faf39c4..74ee34a 100644 --- a/nlp_dpr.py +++ b/dpr.py @@ -11,7 +11,7 @@ log = logging.getLogger() @register(output_schema=['vec']) -class NlpDpr(NNOperator): +class Dpr(NNOperator): """ This class uses Dense Passage Retrieval to generate embedding. Dense Passage Retrieval (DPR) is a set of tools and models for state-of-the-art open-domain Q&A research.