flow like the river
This commit is contained in:
commit
013fe673f3
42435 changed files with 5764238 additions and 0 deletions
14
BACK_BACK/OBSEI/analyzer.py
Executable file
14
BACK_BACK/OBSEI/analyzer.py
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
from obsei.analyzer.classification_analyzer import ClassificationAnalyzerConfig, ZeroShotClassificationAnalyzer
|
||||
|
||||
# initialize classification analyzer config
|
||||
# It can also detect sentiments if "positive" and "negative" labels are added.
|
||||
analyzer_config=ClassificationAnalyzerConfig(
|
||||
labels=["service", "delay", "performance"],
|
||||
)
|
||||
|
||||
# initialize classification analyzer
|
||||
# For supported models refer https://huggingface.co/models?filter=zero-shot-classification
|
||||
analyzer = ZeroShotClassificationAnalyzer(
|
||||
model_name_or_path="typeform/mobilebert-uncased-mnli",
|
||||
device="auto"
|
||||
)
|
||||
14
BACK_BACK/OBSEI/analyzer/classification_analyzer.py
Executable file
14
BACK_BACK/OBSEI/analyzer/classification_analyzer.py
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
from obsei.analyzer.classification_analyzer import ClassificationAnalyzerConfig, ZeroShotClassificationAnalyzer
|
||||
|
||||
# initialize classification analyzer config
|
||||
# It can also detect sentiments if "positive" and "negative" labels are added.
|
||||
analyzer_config=ClassificationAnalyzerConfig(
|
||||
labels=["service", "delay", "performance"],
|
||||
)
|
||||
|
||||
# initialize classification analyzer
|
||||
# For supported models refer https://huggingface.co/models?filter=zero-shot-classification
|
||||
text_analyzer = ZeroShotClassificationAnalyzer(
|
||||
model_name_or_path="typeform/mobilebert-uncased-mnli",
|
||||
device="auto"
|
||||
)
|
||||
7
BACK_BACK/OBSEI/analyzer/dummy_analyzer.py
Executable file
7
BACK_BACK/OBSEI/analyzer/dummy_analyzer.py
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
from obsei.analyzer.dummy_analyzer import DummyAnalyzer, DummyAnalyzerConfig
|
||||
|
||||
# initialize dummy analyzer's configuration settings
|
||||
analyzer_config = DummyAnalyzerConfig()
|
||||
|
||||
# initialize dummy analyzer
|
||||
analyzer = DummyAnalyzer()
|
||||
11
BACK_BACK/OBSEI/analyzer/ner_analyzer.py
Executable file
11
BACK_BACK/OBSEI/analyzer/ner_analyzer.py
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
from obsei.analyzer.ner_analyzer import NERAnalyzer
|
||||
|
||||
# NER analyzer does not need configuration settings
|
||||
analyzer_config=None
|
||||
|
||||
# initialize ner analyzer
|
||||
# For supported models refer https://huggingface.co/models?filter=token-classification
|
||||
text_analyzer = NERAnalyzer(
|
||||
model_name_or_path="elastic/distilbert-base-cased-finetuned-conll03-english",
|
||||
device = "auto"
|
||||
)
|
||||
22
BACK_BACK/OBSEI/analyzer/pii_analyzer.py
Executable file
22
BACK_BACK/OBSEI/analyzer/pii_analyzer.py
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
from obsei.analyzer.pii_analyzer import PresidioEngineConfig, PresidioModelConfig, \
|
||||
PresidioPIIAnalyzer, PresidioPIIAnalyzerConfig
|
||||
|
||||
# initialize pii analyzer's config
|
||||
analyzer_config = PresidioPIIAnalyzerConfig(
|
||||
# Whether to return only pii analysis or anonymize text
|
||||
analyze_only=False,
|
||||
# Whether to return detail information about anonymization decision
|
||||
return_decision_process=True
|
||||
)
|
||||
|
||||
# initialize pii analyzer
|
||||
analyzer = PresidioPIIAnalyzer(
|
||||
engine_config=PresidioEngineConfig(
|
||||
# spacy and stanza nlp engines are supported
|
||||
# For more info refer
|
||||
# https://microsoft.github.io/presidio/analyzer/developing_recognizers/#utilize-spacy-or-stanza
|
||||
nlp_engine_name="spacy",
|
||||
# Update desired spacy model and language
|
||||
models=[PresidioModelConfig(model_name="en_core_web_lg", lang_code="en")]
|
||||
)
|
||||
)
|
||||
7
BACK_BACK/OBSEI/analyzer/sentiment_analyzer.py
Executable file
7
BACK_BACK/OBSEI/analyzer/sentiment_analyzer.py
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
from obsei.analyzer.sentiment_analyzer import VaderSentimentAnalyzer
|
||||
|
||||
# Vader does not need any configuration settings
|
||||
analyzer_config=None
|
||||
|
||||
# initialize vader sentiment analyzer
|
||||
text_analyzer = VaderSentimentAnalyzer()
|
||||
11
BACK_BACK/OBSEI/analyzer/translation_analyzer.py
Executable file
11
BACK_BACK/OBSEI/analyzer/translation_analyzer.py
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
from obsei.analyzer.translation_analyzer import TranslationAnalyzer
|
||||
|
||||
# Translator does not need analyzer config
|
||||
analyzer_config = None
|
||||
|
||||
# initialize translator
|
||||
# For supported models refer https://huggingface.co/models?pipeline_tag=translation
|
||||
analyzer = TranslationAnalyzer(
|
||||
model_name_or_path="Helsinki-NLP/opus-mt-hi-en",
|
||||
device = "auto"
|
||||
)
|
||||
10
BACK_BACK/OBSEI/informer.py
Executable file
10
BACK_BACK/OBSEI/informer.py
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
from pandas import DataFrame
|
||||
from obsei.sink.pandas_sink import PandasSink, PandasSinkConfig
|
||||
|
||||
# initialize pandas sink config
|
||||
sink_config = PandasSinkConfig(
|
||||
dataframe=DataFrame()
|
||||
)
|
||||
|
||||
# initialize pandas sink
|
||||
sink = PandasSink()
|
||||
17
BACK_BACK/OBSEI/observer.py
Executable file
17
BACK_BACK/OBSEI/observer.py
Executable file
|
|
@ -0,0 +1,17 @@
|
|||
import pandas as pd
|
||||
from obsei.source.pandas_source import PandasSource, PandasSourceConfig
|
||||
|
||||
# Initialize your Pandas DataFrame from your sources like csv, excel, sql etc
|
||||
# In following example we are reading csv which have two columns title and text
|
||||
csv_file = "https://raw.githubusercontent.com/deepset-ai/haystack/master/tutorials/small_generator_dataset.csv"
|
||||
dataframe = pd.read_csv(csv_file)
|
||||
|
||||
# initialize pandas sink config
|
||||
sink_config = PandasSourceConfig(
|
||||
dataframe=dataframe,
|
||||
include_columns=["score"],
|
||||
text_columns=["name", "degree"],
|
||||
)
|
||||
|
||||
# initialize pandas sink
|
||||
sink = PandasSource()
|
||||
10
BACK_BACK/OBSEI/sink/panadas_sink.py
Executable file
10
BACK_BACK/OBSEI/sink/panadas_sink.py
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
from pandas import DataFrame
|
||||
from obsei.sink.pandas_sink import PandasSink, PandasSinkConfig
|
||||
|
||||
# initialize pandas sink config
|
||||
sink_config = PandasSinkConfig(
|
||||
dataframe=DataFrame()
|
||||
)
|
||||
|
||||
# initialize pandas sink
|
||||
sink = PandasSink()
|
||||
0
BACK_BACK/OBSEI/source/pandas_source.py
Executable file
0
BACK_BACK/OBSEI/source/pandas_source.py
Executable file
Loading…
Add table
Add a link
Reference in a new issue