diff --git a/.buildinfo b/.buildinfo new file mode 100644 index 0000000..ca30b1d --- /dev/null +++ b/.buildinfo @@ -0,0 +1,4 @@ +# Sphinx build info version 1 +# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. +config: 9fbfcbdaa80def9ef32635d9e97a9e35 +tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/_images/component-diagram-with-controller.svg b/_images/component-diagram-with-controller.svg new file mode 100644 index 0000000..778caeb --- /dev/null +++ b/_images/component-diagram-with-controller.svg @@ -0,0 +1,4 @@ + + + +
«component»
Base Data Collector
«component»Base Data Collector
«component»
Value Predictor
«component»...
SumUp
SumUp
«component»
Lead Form
«component»...
«component»
Customer Relationship
Management
«component»...
«component»
Controller
«component»Controller
Text is not SVG - cannot display
diff --git a/_images/component-diagram.svg b/_images/component-diagram.svg new file mode 100644 index 0000000..4aab7d4 --- /dev/null +++ b/_images/component-diagram.svg @@ -0,0 +1,4 @@ + + + +
«component»
Base Data Collector
«component»
Merchant Size Predictor
SumUp
«component»
Lead Form
«component»
Customer Relationship
Management
AWS S3
diff --git a/_images/controller-workflow-diagram.jpg b/_images/controller-workflow-diagram.jpg new file mode 100644 index 0000000..b978bec Binary files /dev/null and b/_images/controller-workflow-diagram.jpg differ diff --git a/_images/google_places_strategy.drawio.png b/_images/google_places_strategy.drawio.png new file mode 100644 index 0000000..cc6bf22 Binary files /dev/null and b/_images/google_places_strategy.drawio.png differ diff --git a/_images/sequence-diagram.svg b/_images/sequence-diagram.svg new file mode 100644 index 0000000..281a4cb --- /dev/null +++ b/_images/sequence-diagram.svg @@ -0,0 +1,4 @@ + + + +
:Base Data Collector
:Base Data Colle...
return
return
:Lead Form
:Lead Form
newLead()
newLead()
:Controller
:Controller
getPrediction()
getPrediction()
collectData()
collectData()
savePrediction()
savePrediction()
:Estimated Value Predictor
:Estimated Value...
return
return
Text is not SVG - cannot display
diff --git a/_modules/bdc/pipeline.html b/_modules/bdc/pipeline.html new file mode 100644 index 0000000..6fa4352 --- /dev/null +++ b/_modules/bdc/pipeline.html @@ -0,0 +1,189 @@ + + + + + + bdc.pipeline — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for bdc.pipeline

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Lucca Baumgärtner <lucca.baumgaertner@fau.de>
+# SPDX-FileCopyrightText: 2023 Sophie Heasman <sophieheasmann@gmail.com>
+from datetime import datetime
+
+import numpy as np
+
+from bdc.steps.step import Step, StepError
+from database import get_database
+from logger import get_logger
+
+log = get_logger()
+
+
+
+[docs] +class Pipeline: + def __init__( + self, + steps, + limit: int = None, + ): + self.steps: list[Step] = steps + self.limit: int = limit + self.df = get_database().get_dataframe() + + if limit is not None: + self.df = self.df[:limit] + +
+[docs] + def run(self): + run_id = datetime.now().strftime("%Y/%m/%d/%H%M%S/") + error_occurred = False + if self.df is None: + log.error( + "Error: DataFrame of pipeline has not been initialized, aborting pipeline run!" + ) + return + + # helper to pass the dataframe and/or input location from previous step to next step + for step in self.steps: + log.info(f"Processing step {step.name}") + # load dataframe and/or input location for this step + if step.df is None: + step.df = self.df.copy() + + try: + step.load_data() + verified = step.verify() + log.info(f"Verification for step {step.name}: {verified}") + data_present = step.check_data_presence() + if verified and not data_present: + step_df = step.run() + self.df = step_df + + # cleanup + step.finish() + except (StepError, Exception) as e: + error_occurred = True + log.error(f"Step {step.name} failed! {e}") + finally: + # Create snapshots to avoid data loss + get_database().create_snapshot(step.df, prefix=run_id, name=step.name) + + self.df = self.df.replace(np.nan, None) + + # Set dataframe in DAL + get_database().set_dataframe(self.df) + + # Upload DAL dataframe to chosen database + get_database().save_dataframe() + + # Delete snapshots + if not error_occurred: + get_database().clean_snapshots(run_id) + + log.info(f"Pipeline finished running {len(self.steps)} steps!")
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/bdc/steps/analyze_emails.html b/_modules/bdc/steps/analyze_emails.html new file mode 100644 index 0000000..e7f032e --- /dev/null +++ b/_modules/bdc/steps/analyze_emails.html @@ -0,0 +1,287 @@ + + + + + + bdc.steps.analyze_emails — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for bdc.steps.analyze_emails

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Lucca Baumgärtner <lucca.baumgaertner@fau.de>
+
+import pandas as pd
+from email_validator import EmailNotValidError, validate_email
+
+from bdc.steps.helpers import get_lead_hash_generator
+from bdc.steps.step import Step
+from logger import get_logger
+
+log = get_logger()
+
+
+
+[docs] +def extract_custom_domain(email: str) -> pd.Series: + try: + validate_email(email, check_deliverability=False) + return pd.Series([email.split("@")[1], True]) + except EmailNotValidError as e: + return pd.Series([None, False])
+ + + +
+[docs] +def analyze_email_account(lead) -> pd.Series: + if not lead["email_valid"]: + return pd.Series([False, False]) + email_account = lead["Email"].split("@")[0] + first_name_in_account = ( + lead["First Name"].lower() in email_account.lower() + if "First Name" in lead + else False + ) + last_name_in_account = ( + lead["Last Name"].lower() in email_account.lower() + if "Last Name" in lead + else False + ) + return pd.Series([first_name_in_account, last_name_in_account])
+ + + +
+[docs] +class AnalyzeEmails(Step): + """ + A pipeline step performing various preprocessing steps with the given email address. + The following columns will be added on successful processing: + + - **domain**: The custom domain name/website if any + - **email_valid**: Boolean result of email check + - **first_name_in_account**: Boolean, True if the given first name is part of the email account name + - **last_name_in_account**: Boolean, True if the given last name is part of the email account name + + Attributes: + name: Name of this step, used for logging + added_cols: List of fields that will be added to the main dataframe by executing this step + required_cols: List of fields that are required to be existent in the input dataframe before performing this step + + Added Columns: + domain (str): The custom domain name/website if any + email_valid (bool): Boolean result of email check + first_name_in_account (bool): Boolean, True if the given first name is part of the email account name + last_name_in_account (bool): Boolean, True if the given last name is part of the email account name + """ + + name = "Analyze-Emails" + + added_cols = [ + "domain", + "email_valid", + "first_name_in_account", + "last_name_in_account", + ] + + required_cols = ["Email", "First Name", "Last Name"] + +
+[docs] + def load_data(self): + pass
+ + +
+[docs] + def verify(self): + return super().verify()
+ + +
+[docs] + def run(self): + commercial_domains = [ + "web.de", + "mail.com", + "mail.de", + "msn.com", + "gmail.com", + "yahoo.com", + "hotmail.com", + "aol.com", + "hotmail.co.uk", + "hotmail.fr", + "yahoo.fr", + "live.com", + "gmx.de", + "outlook.com", + "icloud.com", + "outlook.de", + "online.de", + "gmx.net", + "googlemail.com", + "yahoo.de", + "t-online.de", + "gmx.ch", + "gmx.at", + "hotmail.ch", + "live.nl", + "hotmail.de", + "home.nl", + "bluewin.ch", + "freenet.de", + "upcmail.nl", + "zeelandnet.nl", + "hotmail.nl", + "arcor.de", + "aol.de", + "me.com", + "gmail.con", + "office.de", + "my.com", + ] + # extract domain from email + # Possibly add the normalized email here + # self.df[["domain", "email_valid"]] = self.df.apply( + # lambda lead: extract_custom_domain(str(lead["Email"])), axis=1 + # ) + + self.df[["domain", "email_valid"]] = self.df.apply( + lambda lead: get_lead_hash_generator().hash_check( + lead, + extract_custom_domain, + self.name + "_Custom-Domains", + ["domain", "email_valid"], + str(lead["Email"]), + ), + axis=1, + ) + + self.df[["first_name_in_account", "last_name_in_account"]] = self.df.apply( + lambda lead: get_lead_hash_generator().hash_check( + lead, + analyze_email_account, + self.name + "_Email-Accounts", + ["first_name_in_account", "last_name_in_account"], + lead, + ), + axis=1, + ) + + # self.df[["first_name_in_account", "last_name_in_account"]] = self.df.apply( + # lambda lead: analyze_email_account(lead), axis=1 + # ) + + # remove commercial domains + self.df["domain"].replace(commercial_domains, None, inplace=True) + return self.df
+ + +
+[docs] + def finish(self): + p_custom_domains = self.df["domain"].notna().sum() / len(self.df) * 100 + log.info(f"Percentage of custom domains: {p_custom_domains:.2f}%")
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/bdc/steps/analyze_reviews.html b/_modules/bdc/steps/analyze_reviews.html new file mode 100644 index 0000000..2052fe3 --- /dev/null +++ b/_modules/bdc/steps/analyze_reviews.html @@ -0,0 +1,822 @@ + + + + + + bdc.steps.analyze_reviews — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for bdc.steps.analyze_reviews

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Berkay Bozkurt <resitberkaybozkurt@gmail.com>
+# SPDX-FileCopyrightText: 2023 Sophie Heasman <sophieheasmann@gmail.com>
+
+import time
+from collections import Counter
+
+import numpy as np
+import openai
+import pandas as pd
+import tiktoken
+from pandas import DataFrame
+from sklearn.linear_model import LinearRegression
+from tqdm import tqdm
+
+from bdc.steps.helpers import TextAnalyzer, get_lead_hash_generator
+from bdc.steps.step import Step, StepError
+from config import OPEN_AI_API_KEY
+from database import get_database
+from logger import get_logger
+
+log = get_logger()
+
+
+"""
+HELPER FUNCTIONS
+"""
+
+
+
+[docs] +def is_review_valid(review): + """ + Checks if the review is valid (has text and original language). + + Parameters: + review (dict): A dictionary representing a review. + + Returns: + bool: True if the review is valid, False otherwise. + """ + return not (review["text"] is None or review["lang"] is None)
+ + + +
+[docs] +def check_api_key(api_key, api_name): + """ + Checks if an API key is provided for a specific API. + + Args: + api_key (str): The API key to be checked. + api_name (str): The name of the API. + + Raises: + StepError: If the API key is not provided. + + Returns: + bool: True if the API key is provided, False otherwise. + """ + if api_key is None: + raise StepError(f"An API key for {api_name} is needed to run this step!") + else: + return True
+ + + +""" +CLASSES +""" + + +
+[docs] +class GPTReviewSentimentAnalyzer(Step): + """ + A class that performs sentiment analysis on reviews using GPT-4 model. + + Attributes: + name (str): The name of the step. + model (str): The GPT model to be used for sentiment analysis. + model_encoding_name (str): The encoding name of the GPT model. + MAX_PROMPT_TOKENS (int): The maximum number of tokens allowed for a prompt. + no_answer (str): The default value for no answer. + gpt_required_fields (dict): The required fields for GPT analysis. + system_message_for_sentiment_analysis (str): The system message for sentiment analysis. + user_message_for_sentiment_analysis (str): The user message for sentiment analysis. + extracted_col_name (str): The name of the column to store the sentiment scores. + added_cols (list): The list of additional columns to be added to the DataFrame. + gpt (openai.OpenAI): The GPT instance for sentiment analysis. + + Methods: + load_data(): Loads the GPT model. + verify(): Verifies the validity of the API key and DataFrame. + run(): Runs the sentiment analysis on the reviews. + finish(): Finishes the sentiment analysis step. + run_sentiment_analysis(place_id): Runs sentiment analysis on the reviews of a lead. + gpt_sentiment_analyze_review(review_list): Calculates the sentiment score using GPT. + extract_text_from_reviews(reviews_list): Extracts text from reviews and removes line characters. + num_tokens_from_string(text): Returns the number of tokens in a text string. + batch_reviews(reviews, max_tokens): Batches reviews into smaller batches based on token limit. + + Added Columns: + reviews_sentiment_score (float): The sentiment score of the reviews. + """ + + name = "GPT-Review-Sentiment-Analyzer" + model = "gpt-4" + model_encoding_name = "cl100k_base" + text_analyzer = TextAnalyzer() + MAX_PROMPT_TOKENS = 4096 + no_answer = "None" + gpt_required_fields = {"place_id": "google_places_place_id"} + system_message_for_sentiment_analysis = f"You are review sentiment analyzer, you being provided reviews of the companies. You analyze the review and come up with the score between range [-1, 1], if no reviews then just answer with '{no_answer}'" + user_message_for_sentiment_analysis = "Sentiment analyze the reviews and provide me a score between range [-1, 1] : {}" + extracted_col_name = "reviews_sentiment_score" + added_cols = [extracted_col_name] + required_cols = gpt_required_fields.values() + gpt = None + +
+[docs] + def load_data(self) -> None: + """ + Loads the GPT model. + """ + self.gpt = openai.OpenAI(api_key=OPEN_AI_API_KEY)
+ + +
+[docs] + def verify(self) -> bool: + """ + Verifies the validity of the API key and DataFrame. + + Returns: + bool: True if the API key and DataFrame are valid, False otherwise. + """ + + is_key_valid = check_api_key(OPEN_AI_API_KEY, "OpenAI") + return super().verify() and is_key_valid
+ + +
+[docs] + def run(self) -> DataFrame: + """ + Runs the sentiment analysis on the reviews. + + Returns: + DataFrame: The DataFrame with the sentiment scores added. + """ + tqdm.pandas(desc="Running sentiment analysis on reviews") + + self.df[self.extracted_col_name] = self.df.progress_apply( + lambda lead: get_lead_hash_generator().hash_check( + lead, + self.run_sentiment_analysis, + self.name, + self.extracted_col_name, + lead[self.gpt_required_fields["place_id"]], + ), + axis=1, + ) + + # self.df[self.extracted_col_name] = self.df[ + # self.gpt_required_fields["place_id"] + # ].progress_apply(lambda place_id: self.run_sentiment_analysis(place_id)) + return self.df
+ + +
+[docs] + def finish(self) -> None: + pass
+ + +
+[docs] + def run_sentiment_analysis(self, place_id): + """ + Runs sentiment analysis on reviews of lead extracted from company's website. + + Args: + place_id: The ID of the place. + + Returns: + float: The average sentiment score of the reviews. + """ + # if there is no reviews_path, then return without API call. + if place_id is None or pd.isna(place_id): + return None + cached_result = get_database().fetch_gpt_result(place_id, self.name) + if cached_result: + return cached_result["result"] + reviews = get_database().fetch_review(place_id) + avg_score = self.textblob_calculate_avg_sentiment_score(reviews) + get_database().save_gpt_result(avg_score, place_id, self.name) + return avg_score
+ + +
+[docs] + def gpt_calculate_avg_sentiment_score(self, reviews): + """ + Calculates the average sentiment score for a list of reviews using GPT. + + Args: + reviews (list): A list of review texts. + + Returns: + float: The average sentiment score. + + """ + review_texts = self.extract_text_from_reviews(reviews) + # batch reviews so that we do not exceed the token limit of gpt4 + review_batches = self.batch_reviews(review_texts, self.MAX_PROMPT_TOKENS) + scores = 0 + # iterate over each batch and calculate average sentiment score + for review_batch in review_batches: + sentiment_score = self.gpt_sentiment_analyze_review(review_batch) + scores += sentiment_score or 0 + avg_score = scores / len(review_batches) + return avg_score
+ + +
+[docs] + def textblob_calculate_avg_sentiment_score(self, reviews): + """ + Calculates the average sentiment score for a list of reviews using TextBlob sentiment analysis. + + Args: + reviews (list): A list of dictionaries containing review text and language information. + Returns: + float: The average sentiment score for the reviews. + """ + reviews_langs = [ + { + "text": review.get("text", ""), + "lang": review.get("original_language", "en"), + } + for review in reviews + ] + if len(reviews_langs) == 0: + return None + scores = 0 + for review in reviews_langs: + score = self.text_analyzer.calculate_sentiment_analysis_score( + review["text"], review["lang"] + ) + scores += score or 0 + avg_score = scores / len(reviews_langs) + return avg_score
+ + +
+[docs] + def gpt_sentiment_analyze_review(self, review_list): + """ + GPT calculates the sentiment score considering the reviews. + + Args: + review_list: The list of reviews. + + Returns: + float: The sentiment score calculated by GPT. + """ + max_retries = 5 # Maximum number of retries + retry_delay = 5 # Initial delay in seconds (5 seconds) + + for attempt in range(max_retries): + try: + log.info(f"Attempt {attempt+1} of {max_retries}") + response = self.gpt.chat.completions.create( + model=self.model, + messages=[ + { + "role": "system", + "content": self.system_message_for_sentiment_analysis, + }, + { + "role": "user", + "content": self.user_message_for_sentiment_analysis.format( + review_list + ), + }, + ], + temperature=0, + ) + # Extract and return the sentiment score + sentiment_score = response.choices[0].message.content + if sentiment_score and sentiment_score != self.no_answer: + return float(sentiment_score) + else: + log.info("No valid sentiment score found in the response.") + return None + except openai.RateLimitError as e: + if attempt < max_retries - 1: + log.warning( + f"Rate limit exceeded, retrying in {retry_delay} seconds..." + ) + time.sleep(retry_delay) + retry_delay *= 2 # Exponential backoff + else: + log.error("Max retries reached. Unable to complete the request.") + break + except ( + openai.APITimeoutError, + openai.APIConnectionError, + openai.BadRequestError, + openai.AuthenticationError, + openai.PermissionDeniedError, + ) as e: + log.error(f"An error occurred with GPT API: {e}") + break + except Exception as e: + log.error(f"An unexpected error occurred: {e}") + break + + # Return None if the request could not be completed successfully + return None
+ + +
+[docs] + def extract_text_from_reviews(self, reviews_list): + """ + Extracts text from reviews and removes line characters. + + Args: + reviews_list: The list of reviews. + + Returns: + list: The list of formatted review texts. + """ + reviews_texts = [review.get("text", None) for review in reviews_list] + review_texts_formatted = [ + review.strip().replace("\n", " ") for review in reviews_texts if review + ] + return review_texts_formatted
+ + +
+[docs] + def num_tokens_from_string(self, text: str): + """ + Returns the number of tokens in a text string. + + Args: + text (str): The input text. + + Returns: + int: The number of tokens in the text. + """ + encoding = tiktoken.get_encoding(self.model_encoding_name) + num_tokens = len(encoding.encode(text)) + return num_tokens
+ + +
+[docs] + def batch_reviews(self, reviews, max_tokens=4096): + """ + Batches reviews into smaller batches based on token limit. + + Args: + reviews: The list of reviews. + max_tokens (int): The maximum number of tokens allowed for a batch. + + Returns: + list: The list of batches. + """ + batches = [] + current_batch = [] + current_count = self.num_tokens_from_string( + self.user_message_for_sentiment_analysis + ) + + for review in reviews: + token_count = self.num_tokens_from_string(review) + if current_count + token_count > max_tokens: + batches.append(current_batch) + current_batch = [review] + current_count = token_count + else: + current_batch.append(review) + current_count += token_count + + if current_batch: + batches.append(current_batch) + + return batches
+
+ + + +
+[docs] +class SmartReviewInsightsEnhancer(Step): + """ + A step class that enhances review insights for smart review analysis. + + Attributes: + name (str): The name of the step. + required_fields (dict): A dictionary of required fields for the step. + language_tools (dict): A dictionary of language tools for different languages. + MIN_RATINGS_COUNT (int): The minimum number of ratings required to identify polarization. + RATING_DOMINANCE_THRESHOLD (float): The threshold for high or low rating dominance in decimal. + added_cols (list): A list of added columns for the enhanced review insights. + + Methods: + load_data(): Loads the data for the step. + verify(): Verifies if the required fields are present in the data. + run(): Runs the step and enhances the review insights. + finish(): Finishes the step. + _get_language_tool(lang): Get the language tool for the specified language. + _enhance_review_insights(lead): Enhances the review insights for a given lead. + _analyze_rating_trend(rating_time): Analyzes the general trend of ratings over time. + _quantify_polarization(ratings): Analyzes and quantifies the polarization in a list of ratings. + _determine_polarization_type(polarization_score, highest_rating_ratio, lowest_rating_ratio, threshold): Determines the type of polarization based on rating ratios and a threshold. + _calculate_average_grammatical_score(reviews): Calculates the average grammatical score for a list of reviews. + _calculate_score(review): Calculates the score for a review. + _grammatical_errors(text, lang): Calculates the number of grammatical errors in a text. + + Added Columns: + review_avg_grammatical_score (float): The average grammatical score of the reviews. + review_polarization_type (str): The type of polarization in the reviews. + review_polarization_score (float): The score of polarization in the reviews. + review_highest_rating_ratio (float): The ratio of highest ratings in the reviews. + review_lowest_rating_ratio (float): The ratio of lowest ratings in the reviews. + review_rating_trend (float): The trend of ratings over time. + """ + + name = "Smart-Review-Insights-Enhancer" + required_fields = {"place_id": "google_places_place_id"} + text_analyzer = TextAnalyzer() + MIN_RATINGS_COUNT = 1 + RATING_DOMINANCE_THRESHOLD = ( + 0.4 # Threshold for high or low rating dominance in percentage (1.0 == 100%) + ) + + added_cols = [ + "review_avg_grammatical_score", + "review_polarization_type", + "review_polarization_score", + "review_highest_rating_ratio", + "review_lowest_rating_ratio", + "review_rating_trend", + ] + +
+[docs] + def load_data(self) -> None: + """ + Loads the data for the step. + """ + pass
+ + +
+[docs] + def verify(self) -> bool: + """ + Verifies if the required fields are present in the data. + + Returns: + bool: True if the required fields are present, False otherwise. + """ + return super().verify()
+ + +
+[docs] + def run(self) -> DataFrame: + """ + Runs the step and enhances the review insights. + + Returns: + DataFrame: The enhanced DataFrame with the added review insights. + """ + tqdm.pandas(desc="Running reviews insights enhancement") + + # Apply the enhancement function + self.df[self.added_cols] = self.df.progress_apply( + lambda lead: pd.Series( + get_lead_hash_generator().hash_check( + lead, + self._enhance_review_insights, + self.name, + self.added_cols, + lead, + ) + ), + axis=1, + ) + + # self.df[self.added_cols] = self.df.progress_apply( + # lambda lead: pd.Series(self._enhance_review_insights(lead)), axis=1 + # ) + return self.df
+ + +
+[docs] + def finish(self) -> None: + """ + Finishes the step. + """ + pass
+ + +
+[docs] + def _enhance_review_insights(self, lead): + """ + Enhances the review insights for a given lead. + + Args: + lead (pd.Series): The lead data. + + Returns: + pd.Series: The enhanced review insights as a pandas Series. + """ + place_id = lead["google_places_place_id"] + if place_id is None or pd.isna(place_id): + return pd.Series({f"{col}": None for col in self.added_cols}) + reviews = get_database().fetch_review(place_id) + if not reviews: + return pd.Series({f"{col}": None for col in self.added_cols}) + results = [] + reviews_langs = [ + { + "text": review.get("text", ""), + "lang": review.get("original_language", "en"), + } + for review in reviews + ] + avg_gram_sco = self._calculate_average_grammatical_score(reviews_langs) + results.append(avg_gram_sco) + + ratings = [ + review["rating"] + for review in reviews + if "rating" in review and review["rating"] is not None + ] + + polarization_results = list(self._quantify_polarization(ratings)) + results += polarization_results + + rating_time = [ + { + "time": review.get("time"), + "rating": review.get("rating"), + } + for review in reviews + ] + + rating_trend = self._analyze_rating_trend(rating_time) + results.append(rating_trend) + + extracted_features = dict(zip(self.added_cols, results)) + + return pd.Series(extracted_features)
+ + +
+[docs] + def _analyze_rating_trend(self, rating_time): + """ + Analyzes the general trend of ratings over time. + + Args: + rating_time (list): List of review data, each a dict with 'time' (Unix timestamp) and 'rating'. + + Returns: + float: A value between -1 and 1 indicating the trend of ratings. + - A value close to 1 indicates a strong increasing trend. + - A value close to -1 indicates a strong decreasing trend. + - A value around 0 indicates no significant trend (stable ratings). + """ + # Convert to DataFrame + df = pd.DataFrame(rating_time) + + # Convert Unix timestamp to numerical value (e.g., days since the first review) + df["date"] = pd.to_datetime(df["time"], unit="s") + df["days_since_start"] = (df["date"] - df["date"].min()).dt.days + + # Linear regression + model = LinearRegression() + model.fit(df[["days_since_start"]], df["rating"]) + + # Slope of the regression line + slope = model.coef_[0] + + # Normalize the slope to be within the range [-1, 1] + slope_normalized = np.clip(slope, -1, 1) + + # Replace -0 with 0 + return 0 if slope_normalized == 0 else slope_normalized
+ + +
+[docs] + def _quantify_polarization(self, ratings: list): + """ + Analyzes and quantifies the polarization in a list of ratings. + + Args: + ratings (list): List of ratings. + + Returns: + tuple: A tuple containing the polarization type, polarization score, + highest rating ratio, and lowest rating ratio. + """ + + total_ratings = len(ratings) + if total_ratings <= self.MIN_RATINGS_COUNT: + log.info(f"There is no sufficient data to identify polarization") + return "Insufficient data", None, None, None + + rating_counts = Counter(ratings) + high_low_count = rating_counts.get(5, 0) + rating_counts.get(1, 0) + high_low_ratio = high_low_count / total_ratings + middle_ratio = (total_ratings - high_low_count) / total_ratings + highest_rating_ratio = rating_counts.get(5, 0) / total_ratings + lowest_rating_ratio = rating_counts.get(1, 0) / total_ratings + polarization_score = high_low_ratio - middle_ratio + + polarization_type = self._determine_polarization_type( + polarization_score, + highest_rating_ratio, + lowest_rating_ratio, + self.RATING_DOMINANCE_THRESHOLD, + ) + + return ( + polarization_type, + polarization_score, + highest_rating_ratio, + lowest_rating_ratio, + )
+ + +
+[docs] + def _determine_polarization_type( + self, polarization_score, highest_rating_ratio, lowest_rating_ratio, threshold + ): + """ + Determines the type of polarization based on rating ratios and a threshold. + + Args: + polarization_score (float): The polarization score. + highest_rating_ratio (float): The highest rating ratio. + lowest_rating_ratio (float): The lowest rating ratio. + threshold (float): The threshold for high or low rating dominance. + + Returns: + str: The type of polarization. + """ + if polarization_score > 0: + if highest_rating_ratio > threshold: + return "High-Rating Dominance" + elif lowest_rating_ratio > threshold: + return "Low-Rating Dominance" + return "High-Low Polarization" + return "Balanced"
+ + +
+[docs] + def _calculate_average_grammatical_score(self, reviews): + """ + Calculates the average grammatical score for a list of reviews. + + Args: + reviews (list): List of reviews. + + Returns: + float: The average grammatical score. + """ + scores = [ + self._calculate_score(review) + for review in reviews + if is_review_valid(review) + ] + valid_scores = [score for score in scores if score is not None] + return sum(valid_scores) / len(valid_scores) if valid_scores else 0
+ + +
+[docs] + def _calculate_score(self, review): + """ + Calculates the score for a review. + + Args: + review (dict): The review data. + + Returns: + float: The calculated score. + """ + num_errors = self.text_analyzer.find_number_of_grammatical_errors( + review["text"], review["lang"] + ) + num_words = len(review["text"].split()) + if num_words == 0 or num_errors is None: + return None + return max(1 - (num_errors / num_words), 0)
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/bdc/steps/google_places.html b/_modules/bdc/steps/google_places.html new file mode 100644 index 0000000..49c9030 --- /dev/null +++ b/_modules/bdc/steps/google_places.html @@ -0,0 +1,413 @@ + + + + + + bdc.steps.google_places — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for bdc.steps.google_places

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Lucca Baumgärtner <lucca.baumgaertner@fau.de>
+# SPDX-FileCopyrightText: 2023 Sophie Heasman <sophieheasmann@gmail.com>
+# SPDX-FileCopyrightText: 2023 Felix Zailskas <felixzailskas@gmail.com>
+# SPDX-FileCopyrightText: 2023 Fabian-Paul Utech  <f.utech@gmx.net>
+# SPDX-FileCopyrightText: 2023 Ruchita Nathani <Ruchita.nathani@fau.de>
+# SPDX-FileCopyrightText: 2023 Ahmed Sheta <ahmed.sheta@fau.de>
+
+import re
+from http import HTTPStatus
+
+import googlemaps
+import pandas as pd
+from googlemaps.exceptions import ApiError, HTTPError, Timeout, TransportError
+from requests import RequestException
+from tqdm import tqdm
+
+from bdc.steps.helpers import get_lead_hash_generator
+from bdc.steps.step import Step, StepError
+from config import GOOGLE_PLACES_API_KEY
+from logger import get_logger
+
+log = get_logger()
+
+
+
+[docs] +class GooglePlaces(Step): + """ + The GooglePlaces step will try to find the correct business entry in the Google Maps database. It will save basic + information along with the place id, that can be used to retrieve further detailed information and a confidence + score that should indicate the confidence in having found the correct result. Confidence can vary based on the data + source used for identifying the business and if multiple sources are used confidence is higher when results match. + + Attributes: + name: Name of this step, used for logging and as a column prefix + added_cols: List of fields that will be added to the main dataframe by executing this step + required_cols: List of fields that are required to be existent in the input dataframe before performing this step + + Added Columns: + google_places_place_id (str): The place id of the business + google_places_business_status (str): The business status of the business + google_places_formatted_address (str): The formatted address of the business + google_places_name (str): The name of the business + google_places_user_ratings_total (int): The number of user ratings of the business + google_places_rating (float): The rating of the business + google_places_price_level (int): The price level of the business + google_places_candidate_count_mail (int): The number of candidates found by mail search + google_places_candidate_count_phone (int): The number of candidates found by phone search + google_places_place_id_matches_phone_search (bool): Whether the place id found by mail search matches the one found by phone search + google_places_confidence (float): A confidence score for the results + """ + + name = "Google_Places" + + # fields that are expected as an output of the df.apply lambda function + df_fields = [ + "place_id", + "business_status", + "formatted_address", + "name", + "user_ratings_total", + "rating", + "price_level", + "candidate_count_mail", + "candidate_count_phone", + "place_id_matches_phone_search", + "confidence", + ] + + # Weirdly the expression [f"{name}_{field}" for field in df_fields] gives an error as name is not in the scope of the iterator + added_cols = [ + name + field + for (name, field) in zip( + [f"{name.lower()}_"] * (len(df_fields)), + ([f"{field}" for field in df_fields]), + ) + ] + + # fields that are accessed directly from the api + api_fields = [ + "place_id", + "business_status", + "formatted_address", + "name", + "user_ratings_total", + "rating", + "price_level", + ] + + required_cols = [ + "Email", + "domain", + "first_name_in_account", + "last_name_in_account", + "number_formatted", + ] + + gmaps = None + +
+[docs] + def load_data(self) -> None: + """ + Make sure that the API key for Google places is present and construct the API client + """ + # don't perform this in class body or else it will fail in tests due to missing API key + if GOOGLE_PLACES_API_KEY is None: + raise StepError("An API key for Google Places is needed to run this step!") + self.gmaps = googlemaps.Client(key=GOOGLE_PLACES_API_KEY)
+ + +
+[docs] + def verify(self) -> bool: + return super().verify() and GOOGLE_PLACES_API_KEY is not None
+ + +
+[docs] + def run(self) -> pd.DataFrame: + # Call find_places API + tqdm.pandas(desc="Getting info from Find Places API") + + self.df[ + [f"{self.name.lower()}_{field}" for field in self.df_fields] + ] = self.df.progress_apply( + lambda lead: get_lead_hash_generator().hash_check( + lead, + self.get_data_from_google_api, + self.name, + [f"{self.name.lower()}_{field}" for field in self.df_fields], + lead, + ), + axis=1, + ) + + # self.df[ + # [f"{self.name.lower()}_{field}" for field in self.df_fields] + # ] = self.df.progress_apply( + # lambda lead: self.get_data_from_google_api(lead), axis=1 + # ) + + return self.df
+ + +
+[docs] + def finish(self) -> None: + p_matches = ( + self.df["google_places_place_id_matches_phone_search"].sum() + / len(self.df) + * 100 + ) + p_matches_rel = ( + self.df["google_places_place_id_matches_phone_search"].notna().sum() + / len(self.df["google_places_place_id_matches_phone_search"].notna()) + * 100 + ) + + log.info( + f"Percentage of mail search matching phone search (of all): {p_matches:.2f}%" + ) + log.info( + f"Percentage of mail search matching phone search (at least one result): {p_matches_rel:.2f}%" + )
+ + +
+[docs] + def get_data_from_google_api(self, lead_row): + """Request Google Places Text Search API""" + error_return_value = pd.Series([None] * len(self.df_fields)) + + search_query = lead_row["domain"] + phone_number = lead_row["number_formatted"] + + if search_query is None and lead_row["email_valid"]: + account_name = lead_row["Email"].split("@")[0] + if not ( + lead_row["first_name_in_account"] and lead_row["last_name_in_account"] + ): + # use account name as search query and replace special characters with whitespace + search_query = re.sub(r"[^a-zA-Z0-9\n]", " ", account_name) + + if search_query is None and phone_number is None: + # if account name consists only of first and last name and no custom domain is available, + # skip the search as no results are expected + return error_return_value + + response_by_mail, response_count_mail = self.get_first_place_candidate( + search_query, "textquery" + ) + + response_by_phone, response_count_phone = self.get_first_place_candidate( + phone_number, "phonenumber" + ) + + # compare the place_id, if it doesn't match just output results by email for now + if response_by_mail is not None and response_by_phone is not None: + place_id_matches_phone_search = ( + response_by_phone["place_id"] == response_by_mail["place_id"] + ) + else: + place_id_matches_phone_search = False + + chosen_response = ( + response_by_mail if response_by_mail is not None else response_by_phone + ) + + if chosen_response is None: + return error_return_value + + results_list = [ + chosen_response[field] if field in chosen_response else None + for field in self.api_fields + ] + + # add number of candidates, which is not a direct field in the api response but can be derived from it + results_list.append(response_count_mail) + results_list.append(response_count_phone) + + # add boolean indicator whether search by phone result matches search by email + results_list.append(place_id_matches_phone_search) + + # calculate confidence score for google places results + results_list.append(self.calculate_confidence(results_list, lead_row)) + + return pd.Series(results_list)
+ + +
+[docs] + def get_first_place_candidate(self, query, input_type) -> (dict, int): + if query is None: + return None, 0 + try: + response = self.gmaps.find_place(query, input_type, fields=self.api_fields) + + # Retrieve response + # response = requests.get(self.URL + domain + "&key=" + GOOGLE_PLACES_API_KEY) + except RequestException as e: + log.error(f"Error: {str(e)}") + return None, 0 + except (ApiError, HTTPError, Timeout, TransportError) as e: + log.error(f"Error: {str(e.message) if e.message is not None else str(e)}") + return None, 0 + + if not response["status"] == HTTPStatus.OK.name: + log.debug( + f"Failed to fetch data. Status code: {response['status']}", + ) + return None, 0 + + if "candidates" not in response or len(response["candidates"]) == 0: + return None, 0 + + top_result = response["candidates"][0] + no_candidates = len(response["candidates"]) + + return top_result, no_candidates
+ + +
+[docs] + def calculate_confidence(self, results_list, lead) -> float | None: + """ + Calculate some confidence score, representing how sure we are to have found the correct Google Place + (using super secret, patented AI algorithm :P) + :param results_list: + :return: confidence + """ + if results_list[self.df_fields.index("place_id")] is None: + # no result -> no confidence + return None + if results_list[self.df_fields.index("place_id_matches_phone_search")]: + # phone search and email search returned same result -> this has to be it! + return 0.99 + if ( + results_list[self.df_fields.index("candidate_count_mail")] == 0 + and results_list[self.df_fields.index("candidate_count_phone")] == 1 + ): + # phone number is a pretty good identifier + return 0.8 + if ( + results_list[self.df_fields.index("candidate_count_mail")] == 1 + and results_list[self.df_fields.index("candidate_count_phone")] == 0 + ): + if lead["domain"] is not None: + # a custom domain is also a pretty good identifier + return 0.7 + else: + # without a domain the account name is used for search which is often generic + return 0.4 + if ( + results_list[self.df_fields.index("candidate_count_mail")] == 1 + and results_list[self.df_fields.index("candidate_count_phone")] == 1 + ): + # only two results but different... what is that supposed to mean? + return 0.2 + # we found more than 1 result for either search method -> low confidence + return 0.1
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/bdc/steps/google_places_detailed.html b/_modules/bdc/steps/google_places_detailed.html new file mode 100644 index 0000000..6bc027d --- /dev/null +++ b/_modules/bdc/steps/google_places_detailed.html @@ -0,0 +1,280 @@ + + + + + + bdc.steps.google_places_detailed — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    +
  • + + +
  • +
  • +
+
+
+
+
+ +

Source code for bdc.steps.google_places_detailed

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Lucca Baumgärtner <lucca.baumgaertner@fau.de>
+# SPDX-FileCopyrightText: 2023 Sophie Heasman <sophieheasmann@gmail.com>
+# SPDX-FileCopyrightText: 2023 Ruchita Nathani <Ruchita.nathani@fau.de>
+# SPDX-FileCopyrightText: 2023 Ahmed Sheta <ahmed.sheta@fau.de>
+
+import json
+import os
+from http import HTTPStatus
+
+import boto3
+import googlemaps
+import pandas as pd
+from googlemaps.exceptions import ApiError, HTTPError, Timeout, TransportError
+from requests import RequestException
+from tqdm import tqdm
+
+from bdc.steps.helpers import get_lead_hash_generator
+from bdc.steps.step import Step, StepError
+from config import GOOGLE_PLACES_API_KEY
+from database import get_database
+from logger import get_logger
+
+log = get_logger()
+
+
+
+[docs] +class GooglePlacesDetailed(Step): + """ + The GooglePlacesDetailed step will try to gather detailed information for a given google business entry, identified + by the place ID. This information could be the website link, the review text and the business type. Reviews will + be saved to a separate location based on the persistence settings this could be local or AWS S3. + + Attributes: + name: Name of this step, used for logging + added_cols: List of fields that will be added to the main dataframe by executing this step + required_cols: List of fields that are required to be existent in the input dataframe before performing this step + + Added Columns: + google_places_detailed_website (str): The website of the company from google places + google_places_detailed_type (str): The type of the company from google places + """ + + name = "Google_Places_Detailed" + + # fields that are expected as an output of the df.apply lambda function + df_fields = ["website", "type"] + + # Weirdly the expression [f"{name}_{field}" for field in df_fields] gives an error as name is not in the scope of the iterator + added_cols = [ + name + field + for (name, field) in zip( + [f"{name.lower()}_"] * (len(df_fields)), + ([f"{field}" for field in df_fields]), + ) + ] + + required_cols = ["google_places_place_id"] + + # fields that are accessed directly from the api + api_fields = ["website", "type", "reviews"] + + # Output fields are not necessarily the same as input fields + api_fields_output = ["website", "types"] + + gmaps = None + +
+[docs] + def load_data(self) -> None: + # don't perform this in class body or else it will fail in tests due to missing API key + if GOOGLE_PLACES_API_KEY is None: + raise StepError("An API key for Google Places is needed to run this step!") + self.gmaps = googlemaps.Client(key=GOOGLE_PLACES_API_KEY)
+ + +
+[docs] + def verify(self) -> bool: + return super().verify() and GOOGLE_PLACES_API_KEY is not None
+ + +
+[docs] + def run(self) -> pd.DataFrame: + # Call places API + tqdm.pandas(desc="Getting info from Places API") + + # generate_hash = GenerateHashLeads() + self.df[ + [f"{self.name.lower()}_{field}" for field in self.df_fields] + ] = self.df.progress_apply( + lambda lead: get_lead_hash_generator().hash_check( + lead, + self.get_data_from_detailed_google_api, + self.name, + [f"{self.name.lower()}_{field}" for field in self.df_fields], + lead, + ), + axis=1, + ) + + # self.df[ + # [f"{self.name.lower()}_{field}" for field in self.df_fields] + # ] = self.df.progress_apply( + # lambda lead: self.get_data_from_detailed_google_api(lead), axis=1 + # ) + + return self.df
+ + +
+[docs] + def finish(self) -> None: + pass
+ + +
+[docs] + def get_data_from_detailed_google_api(self, lead_row): + error_return_value = pd.Series([None] * len(self.df_fields)) + + place_id = lead_row["google_places_place_id"] + + if place_id is None or pd.isna(place_id): + return error_return_value + + # Call for the detailed API using specified fields + try: + # Fetch place details including reviews + response = self.gmaps.place( + place_id, + fields=self.api_fields, + language="original", + reviews_no_translations=True, + ) + + # Check response status + if response.get("status") != HTTPStatus.OK.name: + log.warning( + f"Failed to fetch data. Status code: {response.get('status')}" + ) + return error_return_value + + except RequestException as e: + log.error(f"Error: {str(e)}") + + except (ApiError, HTTPError, Timeout, TransportError) as e: + error_message = ( + str(e.message) + if hasattr(e, "message") and e.message is not None + else str(e) + ) + log.warning(f"Error: {error_message}") + + reviews = [] + + if "result" in response and "reviews" in response["result"]: + reviews = response["result"]["reviews"] + + get_database().save_review(reviews, place_id) + + results_list = [ + response["result"][field] if field in response["result"] else None + for field in self.api_fields_output + ] + + return pd.Series(results_list)
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/bdc/steps/gpt_summarizer.html b/_modules/bdc/steps/gpt_summarizer.html new file mode 100644 index 0000000..861c414 --- /dev/null +++ b/_modules/bdc/steps/gpt_summarizer.html @@ -0,0 +1,321 @@ + + + + + + bdc.steps.gpt_summarizer — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for bdc.steps.gpt_summarizer

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Berkay Bozkurt <resitberkaybozkurt@gmail.com>
+# SPDX-FileCopyrightText: 2023 Sophie Heasman <sophieheasmann@gmail.com>
+
+
+import time
+from http import HTTPStatus
+
+import openai
+import pandas as pd
+import requests
+from bs4 import BeautifulSoup
+from pandas import DataFrame
+from requests import RequestException
+from tqdm import tqdm
+
+from bdc.steps.helpers import get_lead_hash_generator
+from bdc.steps.step import Step, StepError
+from config import OPEN_AI_API_KEY
+from database import get_database
+from logger import get_logger
+
+log = get_logger()
+
+
+
+[docs] +class GPTSummarizer(Step): + """ + The GPTSummarizer step will attempt to download a businesses website in raw html format and pass this information + to OpenAIs GPT, which will then attempt to summarize the raw contents and extract valuable information for a + salesperson. + + Attributes: + name: Name of this step, used for logging + added_cols: List of fields that will be added to the main dataframe by executing this step + required_cols: List of fields that are required to be existent in the input dataframe before performing this + step + + Added Columns: + sales_person_summary (str): The summary of the company website for the salesperson using GPT + """ + + name = "GPT-Summarizer" + model = "gpt-4" + no_answer = "None" + + # system and user messages to be used for creating company summary for lead using website. + system_message_for_website_summary = f"You are html summarizer, you being provided the companies' htmls and you answer with the summary of three to five sentences including all the necessary information which might be useful for salesperson. If no html then just answer with '{no_answer}'" + user_message_for_website_summary = ( + "Give salesperson a summary using following html: {}" + ) + + extracted_col_name_website_summary = "sales_person_summary" + gpt_required_fields = { + "website": "google_places_detailed_website", + "place_id": "google_places_place_id", + } + + added_cols = [extracted_col_name_website_summary] + required_cols = gpt_required_fields.values() + + client = None + +
+[docs] + def load_data(self) -> None: + self.client = openai.OpenAI(api_key=OPEN_AI_API_KEY)
+ + +
+[docs] + def verify(self) -> bool: + if OPEN_AI_API_KEY is None: + raise StepError("An API key for openAI is need to run this step!") + return super().verify()
+ + +
+[docs] + def run(self) -> DataFrame: + tqdm.pandas(desc="Summarizing the website of leads") + + self.df[self.extracted_col_name_website_summary] = self.df.progress_apply( + lambda lead: get_lead_hash_generator().hash_check( + lead, + self.summarize_the_company_website, + self.name, + self.extracted_col_name_website_summary, + lead[self.gpt_required_fields["website"]], + lead[self.gpt_required_fields["place_id"]], + ), + axis=1, + ) + + # self.df[self.extracted_col_name_website_summary] = self.df.progress_apply( + # lambda lead: self.summarize_the_company_website( + # lead[self.gpt_required_fields["website"]] + # ), + # axis=1, + # ) + return self.df
+ + +
+[docs] + def finish(self) -> None: + pass
+ + +
+[docs] + def summarize_the_company_website(self, website, place_id): + """ + Summarise client website using GPT. Handles exceptions that mightarise from the API call. + """ + + if website is None or pd.isna(website): + return None + company_summary = get_database().fetch_gpt_result(place_id, self.name) + if company_summary: + return company_summary["result"] + + html = self.extract_the_raw_html_and_parse(website) + + if html is None: + return None + max_retries = 5 # Maximum number of retries + retry_delay = 5 # Initial delay in seconds (5 seconds) + + for attempt in range(max_retries): + try: + log.info(f"Attempt {attempt+1} of {max_retries}") + response = self.client.chat.completions.create( + model=self.model, + messages=[ + { + "role": "system", + "content": self.system_message_for_website_summary, + }, + { + "role": "user", + "content": self.user_message_for_website_summary.format( + html + ), + }, + ], + temperature=0, + ) + + # Check if the response contains the expected data + if response.choices[0].message.content: + company_summary = response.choices[0].message.content + + if company_summary == self.no_answer: + return None + get_database().save_gpt_result(company_summary, place_id, self.name) + return company_summary + else: + log.info("No summary data found in the response.") + return None + except openai.RateLimitError as e: + if attempt < max_retries - 1: + log.warning( + f"Rate limit exceeded, retrying in {retry_delay} seconds..." + ) + time.sleep(retry_delay) + retry_delay *= 2 # Exponential backoff + else: + log.error("Max retries reached. Unable to complete the request.") + break + except ( + openai.APITimeoutError, + openai.APIConnectionError, + openai.BadRequestError, + openai.AuthenticationError, + openai.PermissionDeniedError, + Exception, + ) as e: + # Handle possible errors + log.error( + f"An error occurred during summarizing the lead with GPT: {e}" + ) + pass
+ + +
+[docs] + def extract_the_raw_html_and_parse(self, url): + try: + # Send a request to the URL + response = requests.get(url) + except RequestException as e: + log.error(f"An error occured during getting repsonse from url: {e}") + return None + + # If the request was successful + if not response.status_code == HTTPStatus.OK: + log.error(f"Failed to fetch data. Status code: {response.status_code}") + return None + try: + # Use the detected encoding to decode the response content + soup = BeautifulSoup(response.content, "html.parser") + + texts = [] + for element in soup.find_all(["h1", "h2", "h3", "p", "li"]): + texts.append(element.get_text(strip=True)) + return " ".join(texts) + except UnicodeDecodeError as e: + return None
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/bdc/steps/hash_generator.html b/_modules/bdc/steps/hash_generator.html new file mode 100644 index 0000000..781931c --- /dev/null +++ b/_modules/bdc/steps/hash_generator.html @@ -0,0 +1,186 @@ + + + + + + bdc.steps.hash_generator — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for bdc.steps.hash_generator

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Felix Zailskas <felixzailskas@gmail.com>
+
+import pandas as pd
+from pandas import DataFrame
+from tqdm import tqdm
+
+from bdc.steps.helpers import get_lead_hash_generator
+from bdc.steps.step import Step
+from logger import get_logger
+
+log = get_logger()
+
+
+
+[docs] +class HashGenerator(Step): + """ + A pipeline step computing the hashed value of a lead using the basic data that should + be present for every lead. These data include: + + - First Name + - Last Name + - Company / Account + - Phone + - Email + + Attributes: + name: Name of this step, used for logging + added_cols: List of fields that will be added to the main dataframe by executing this step + required_cols: List of fields that are required to be existent in the input dataframe before performing this step + """ + + name = "Hash-Generator" + + added_cols = ["lead_hash"] + + required_cols = [ + "First Name", + "Last Name", + "Company / Account", + "Phone", + "Email", + ] + +
+[docs] + def load_data(self) -> None: + pass
+ + +
+[docs] + def verify(self) -> bool: + return super().verify()
+ + +
+[docs] + def run(self) -> DataFrame: + tqdm.pandas(desc="Generating hash values for all leads") + + # This step cannot be used with the hash_check as it produces the hashes + self.df["lead_hash"] = self.df.progress_apply( + lambda lead: get_lead_hash_generator().hash_lead(lead), axis=1 + ) + + return self.df
+ + +
+[docs] + def finish(self) -> None: + p_hashes_generated = self.df["lead_hash"].notna().sum() / len(self.df) * 100 + log.info(f"Percentage of hashes generated: {p_hashes_generated:.2f}%")
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/bdc/steps/helpers.html b/_modules/bdc/steps/helpers.html new file mode 100644 index 0000000..b08d1b8 --- /dev/null +++ b/_modules/bdc/steps/helpers.html @@ -0,0 +1,129 @@ + + + + + + bdc.steps.helpers — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for bdc.steps.helpers

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Berkay Bozkurt <resitberkaybozkurt@gmail.com>
+
+from .generate_hash_leads import *
+from .offeneregister_api import *
+from .text_analyzer import *
+
+_lead_hash_generator = None
+
+
+
+[docs] +def get_lead_hash_generator() -> LeadHashGenerator: + global _lead_hash_generator + + if _lead_hash_generator is None: + _lead_hash_generator = LeadHashGenerator() + + return _lead_hash_generator
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/bdc/steps/helpers/generate_hash_leads.html b/_modules/bdc/steps/helpers/generate_hash_leads.html new file mode 100644 index 0000000..1e24ac6 --- /dev/null +++ b/_modules/bdc/steps/helpers/generate_hash_leads.html @@ -0,0 +1,201 @@ + + + + + + bdc.steps.helpers.generate_hash_leads — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for bdc.steps.helpers.generate_hash_leads

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Ruchita Nathani <ruchita.nathani@fau.de>
+
+import hashlib
+import os
+from datetime import datetime
+
+import pandas as pd
+
+from database import get_database
+from logger import get_logger
+
+log = get_logger()
+
+
+
+[docs] +class LeadHashGenerator: + BASE_PATH = os.path.dirname(__file__) + _curr_lookup_table = ("", None) + +
+[docs] + def hash_lead(self, lead_data): + # Concatenate key lead information + data_to_hash = ( + str(lead_data["First Name"]) + + str(lead_data["Last Name"]) + + str(lead_data["Company / Account"]) + + str(lead_data["Phone"]) + + str(lead_data["Email"]) + ) + + # Hash the concatenated string using SHA-256 + lead_hash = hashlib.sha256(data_to_hash.encode()).hexdigest() + + return lead_hash
+ + +
+[docs] + def hash_check( + self, + lead_data: pd.Series, + data_fill_function: callable, + step_name: str, + fields_tofill: list[str], + *args, + **kwargs, + ): + if "lead_hash" in lead_data.to_list() and not pd.isna(lead_data["lead_hash"]): + lead_hash = lead_data["lead_hash"] + else: + lead_hash = self.hash_lead(lead_data) + if self._curr_lookup_table[0] != step_name: + self._curr_lookup_table = ( + step_name, + get_database().load_lookup_table(step_name), + ) + + lookup_table = self._curr_lookup_table[1] + + if lead_hash in lookup_table: + # If the hash exists in the lookup table, return the corresponding data + log.debug(f"Hash {lead_hash} already exists in the lookup table.") + try: + previous_data = lead_data[fields_tofill] + return previous_data + except KeyError as e: + log.debug( + f"Hash is present but data fields {fields_tofill} were not found." + ) + lookup_table[lead_hash] = lookup_table[lead_hash][:-1] + [ + datetime.now().strftime("%Y-%m-%d_%H:%M:%S"), + ] + get_database().save_lookup_table(lookup_table, step_name) + return data_fill_function(*args, **kwargs) + + lookup_table[lead_hash] = [ + lead_data["First Name"], + lead_data["Last Name"], + lead_data["Company / Account"], + lead_data["Phone"], + lead_data["Email"], + datetime.now().strftime("%Y-%m-%d_%H:%M:%S"), + ] + get_database().save_lookup_table(lookup_table, step_name) + + return data_fill_function(*args, **kwargs)
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/bdc/steps/helpers/offeneregister_api.html b/_modules/bdc/steps/helpers/offeneregister_api.html new file mode 100644 index 0000000..8b4c4a0 --- /dev/null +++ b/_modules/bdc/steps/helpers/offeneregister_api.html @@ -0,0 +1,470 @@ + + + + + + bdc.steps.helpers.offeneregister_api — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for bdc.steps.helpers.offeneregister_api

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Berkay Bozkurt <resitberkaybozkurt@gmail.com>
+
+import requests
+from bs4 import BeautifulSoup
+
+from logger import get_logger
+
+log = get_logger()
+
+OFFENREGISTER_BASE_URL = "https://db.offeneregister.de/"
+OFFENRENREGISTER_POSITIONS_URL = (
+    OFFENREGISTER_BASE_URL
+    + "openregister/Positions?firstName__exact={}&lastName__exact={}"
+)
+
+OFFENREGISTER_CAPITAL_URL = (
+    OFFENREGISTER_BASE_URL + "openregister/Capital?companyId__exact={}"
+)
+
+OFFENREGISTER_ADDRESSES_URL = (
+    OFFENREGISTER_BASE_URL + "openregister/Addresses?companyId__exact={}"
+)
+
+OFFENREGISTER_NAMES_URL = (
+    OFFENREGISTER_BASE_URL + "openregister/Names?companyId__exact={}"
+)
+
+OFFENREGISTER_OBJECTIVES_URL = (
+    OFFENREGISTER_BASE_URL + "openregister/Objectives?companyId__exact={}"
+)
+
+
+
+[docs] +class OffeneRegisterAPI: + """ + A class that retrieves company data from various sources based on given parameters. + + Methods: + _find_from_Positions_by_firstName_and_lastName(last_name: str, first_name: str) -> dict: + Retrieves company data from Positions table based on the last name and first name of a person. + + _find_row_by_companyId(url: str, company_id: str) -> dict: + Finds and retrieves the row data for a given company ID from a specified URL. + + _find_from_Capital_by_companyId(company_id: str) -> dict: + Retrieves company data from the Capital database using the provided company ID. + + _find_from_Addresses_by_companyId(company_id: str) -> dict: + Retrieves the row from the Addresses table based on the given company ID. + + _find_from_Objectives_by_companyId(company_id: str) -> dict: + Retrieves the row from Objectives by the given company ID. + + _find_from_Names_by_companyId(company_id: str) -> dict: + Retrieves company data by company ID from the offerenregister.de website. + + find_companyName_by_lastName_firstName(last_name: str, first_name: str) -> str: + Finds the company name by the last name and first name of a person. + + find_companyCapitals_by_lastName_firstName(last_name: str, first_name: str) -> tuple: + Retrieves the capital amount and currency of a company based on the last name and first name of a person. + + find_companyObjective_by_lastName_firstName(last_name: str, first_name: str) -> str or None: + Finds the company objective based on the last name and first name of a person. + """ + + def __init__(self) -> None: + pass + + def _find_from_Positions_by_firstName_and_lastName( + self, last_name: str, first_name: str + ) -> dict: + """ + Retrieves company data from Positions by using the first name and last name of a person. + + Args: + last_name (str): The last name of the person. + first_name (str): The first name of the person. + + Returns: + dict: A dictionary containing class name and value pairs of the retrieved data. + """ + url = OFFENRENREGISTER_POSITIONS_URL.format(first_name, last_name) + response = requests.get(url) + + # Check if the request was successful + if response.status_code == 200: + try: + # get table with class name rows-and-columns + soup = BeautifulSoup(response.text, "html.parser") + + # Find the div with the specified class name + div = soup.find("div", {"class": "table-wrapper"}) + + # Find the table within the div + table = div.find("table", {"class": "rows-and-columns"}) + + # Access the tbody element + tbody = table.tbody + + # Find all tr elements within the tbody + rows = tbody.find_all("tr") + + # Print the number of tr elements + # Get the first row + first_row = rows[0] + + # Find all td elements within the first row + columns = first_row.find_all("td") + + # Create a dictionary to store class name and value pairs + col_dict = {} + + # Iterate over each column + for column in columns: + # Get the class name of the column + class_name = column.get("class")[0] if column.get("class") else None + + # Get the text within the column + value = column.text + + # Add the class name and value pair to the dictionary + if class_name: + col_dict[class_name] = value + + # Print the dictionary + return col_dict + except Exception as e: + log.warn(f"Exception occurred: {e}") + return None + else: + log.warn(f"Request failed with status code {response.status_code}") + return None + + def _find_row_by_companyId(self, url, company_id) -> dict: + """ + Finds and retrieves the row data for a given company ID from a specified URL. + + Args: + url (str): The URL to retrieve the data from. + company_id (str): The ID of the company to search for. + + Returns: + dict: A dictionary containing the class name and value pairs for the first row of the table, + or None if the request fails or the company ID is not valid. + """ + if company_id: + url = url.format(company_id) + response = requests.get(url) + + # Check if the request was successful + if response.status_code == 200: + try: + # get table with class name rows-and-columns + soup = BeautifulSoup(response.text, "html.parser") + + # Find the div with the specified class name + div = soup.find("div", {"class": "table-wrapper"}) + + # Find the table within the div + table = div.find("table", {"class": "rows-and-columns"}) + + # Access the tbody element + tbody = table.tbody + # Find all tr elements within the tbody + rows = tbody.find_all("tr") + + # Print the number of tr elements + # Get the first row + first_row = rows[0] + + # Find all td elements within the first row + columns = first_row.find_all("td") + + # Create a dictionary to store class name and value pairs + col_dict = {} + + # Iterate over each column + for column in columns: + # Get the class name of the column + class_name = ( + column.get("class")[0] if column.get("class") else None + ) + + # Get the text within the column + value = column.text + + # Add the class name and value pair to the dictionary + if class_name: + col_dict[class_name] = value + + # Print the dictionary + log.info(col_dict) + return col_dict + except Exception as e: + log.warn(f"Exception occurred: {e}") + return None + else: + log.warn(f"Request failed with status code {response.status_code}") + return None + else: + log.info("Company id is not valid") + return None + + def _find_from_Capital_by_companyId(self, company_id: str) -> dict: + """ + Retrieves company data from the Capital database using the provided company ID. + + Args: + company_id (str): The ID of the company to retrieve data for. + + Returns: + dict: A dictionary containing the retrieved company data. + """ + return self._find_row_by_companyId(OFFENREGISTER_CAPITAL_URL, company_id) + + def _find_from_Addresses_by_companyId(self, company_id: str) -> dict: + """ + Retrieves the row from the Addresses table based on the given company ID. + + Args: + company_id (str): The ID of the company. + + Returns: + dict: The row from the Addresses table that matches the given company ID. + """ + return self._find_row_by_companyId(OFFENREGISTER_ADDRESSES_URL, company_id) + + def _find_from_Objectives_by_companyId(self, company_id: str) -> dict: + """ + Retrieves the row from Objectives by the given company ID. + + Args: + company_id (str): The ID of the company. + + Returns: + dict: The row containing the company data from Objectives. + """ + return self._find_row_by_companyId(OFFENREGISTER_OBJECTIVES_URL, company_id) + + def _find_from_Names_by_companyId(self, company_id: str) -> dict: + """ + Retrieves company data by company ID from the offerenregister.de website. + + Args: + company_id (str): The ID of the company to retrieve data for. + + Returns: + dict: A dictionary containing the retrieved company data. + """ + return self._find_row_by_companyId(OFFENREGISTER_NAMES_URL, company_id) + +
+[docs] + def find_companyName_by_lastName_firstName(self, last_name, first_name): + """ + Finds the company name by the last name and first name of a person. + + Args: + last_name (str): The last name of the person. + first_name (str): The first name of the person. + + Returns: + str: The name of the company if found, None otherwise. + """ + log.debug(f"Finding company name for {first_name} {last_name}") + pos_row = self._find_from_Positions_by_firstName_and_lastName( + last_name, first_name + ) + if pos_row: + company_id = pos_row.get("col-companyId") + log.debug(f"Company id: {company_id}") + name_row = self._find_from_Names_by_companyId(company_id) + if name_row: + company_name = name_row.get("col-name") + log.debug(f"Company name: {company_name}") + return company_name + return None + return None
+ + +
+[docs] + def find_companyCapitals_by_lastName_firstName(self, last_name, first_name): + """ + Retrieves the capital amount and currency of a company based on the last name and first name of a person. + + Args: + last_name (str): The last name of the person. + first_name (str): The first name of the person. + + Returns: + tuple: A tuple containing the capital amount and currency of the company. If the company or capital information is not found, returns (None, None). + """ + log.debug(f"Finding company capital for {first_name} {last_name}") + pos_row = self._find_from_Positions_by_firstName_and_lastName( + last_name, first_name + ) + if pos_row: + company_id = pos_row.get("col-companyId") + log.debug(f"Company id: {company_id}") + capital_row = self._find_from_Capital_by_companyId(company_id) + if capital_row: + cap_amount, cap_currency = ( + capital_row.get("col-capitalAmount"), + capital_row.get("col-capitalCurrency"), + ) + log.debug(f"Capital amount: {cap_amount}") + log.debug(f"Capital currency: {cap_currency}") + return cap_amount, cap_currency + return None, None + return None, None
+ + +
+[docs] + def find_companyObjective_by_lastName_firstName(self, last_name, first_name): + """ + Finds the company objective based on the last name and first name of a person. + + Args: + last_name (str): The last name of the person. + first_name (str): The first name of the person. + + Returns: + str or None: The company objective if found, None otherwise. + """ + log.debug(f"Finding company objective for {first_name} {last_name}") + pos_row = self._find_from_Positions_by_firstName_and_lastName( + last_name, first_name + ) + if pos_row: + company_id = pos_row.get("col-companyId") + log.debug(f"Company id: {company_id}") + objective_row = self._find_from_Objectives_by_companyId(company_id) + if objective_row: + obj = objective_row.get("col-objective") + log.debug(f"Company objective: {obj}") + return obj + return None + return None
+ + +
+[docs] + def find_companyAddress_by_lastName_firstName(self, last_name, first_name): + pos_row = self._find_from_Positions_by_firstName_and_lastName( + last_name, first_name + ) + if pos_row: + company_id = pos_row.get("col-companyId") + address_row = self._find_from_Addresses_by_companyId(company_id) + if address_row: + return address_row.get("col-fullAddress") + return None + return None
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/bdc/steps/helpers/text_analyzer.html b/_modules/bdc/steps/helpers/text_analyzer.html new file mode 100644 index 0000000..ffede5c --- /dev/null +++ b/_modules/bdc/steps/helpers/text_analyzer.html @@ -0,0 +1,369 @@ + + + + + + bdc.steps.helpers.text_analyzer — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for bdc.steps.helpers.text_analyzer

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Berkay Bozkurt <resitberkaybozkurt@gmail.com>
+
+import difflib
+import time
+
+from autocorrect import Speller
+from deep_translator import GoogleTranslator
+from pylanguagetool import api as ltp
+from spellchecker import SpellChecker
+from textblob import TextBlob
+
+from logger import get_logger
+
+log = get_logger()
+
+
+
+[docs] +class TextAnalyzer: + """ + A class that provides text analysis functionalities such as spell checking, correction, and error detection. + """ + + TARGET_LANG = "en" + _instance = None + + def __new__(cls, *args, **kwargs): + if not cls._instance: + cls._instance = super().__new__(cls, *args, **kwargs) + return cls._instance + + def __init__(self): + self.spell_checker_insts = {} + self.speller_insts = {} + self.plt_insts = {} + + def _get_spell_checker(self, lang_setting): + """ + Get an instance of SpellChecker for the specified language. + + Args: + lang_setting (str): The language setting. + + Returns: + SpellChecker: An instance of SpellChecker for the specified language, or None if the language is not supported. + """ + if lang_setting not in self.spell_checker_insts: + try: + self.spell_checker_insts[lang_setting] = SpellChecker( + language=lang_setting + ) + except Exception: + log.warn( + f"Language '{lang_setting}' is not supported or does not exist." + ) + return None + return self.spell_checker_insts[lang_setting] + + def _get_speller(self, lang_setting): + """ + Get an instance of Speller for the specified language. + + Args: + lang_setting (str): The language setting. + + Returns: + Speller: An instance of Speller for the specified language, or None if the language is not supported. + """ + if lang_setting not in self.speller_insts: + try: + self.speller_insts[lang_setting] = Speller(lang=lang_setting) + except Exception: + log.warn( + f"Language '{lang_setting}' is not supported or does not exist." + ) + return None + return self.speller_insts[lang_setting] + + def _find_differences(self, text1, text2): + """ + Compare two texts and return a list of differences. + + Args: + text1 (str): The first text. + text2 (str): The second text. + + Returns: + list: A list of differences. + """ + diff = difflib.ndiff(text1.splitlines(), text2.splitlines()) + return list(diff) + +
+[docs] + def correct_text(self, text, language="en"): + """ + Correct the spelling of the given text using the specified language. + + Args: + text (str): The text to be corrected. + language (str, optional): The language setting. Defaults to "en". + + Returns: + str: The corrected text. + """ + speller = self._get_speller(language) + spell_checker = self._get_spell_checker(language) + + if speller is None and spell_checker is None: + log.warn( + f"Could not find a spell checker or speller for language '{language}'." + ) + return text + + speller_corrected_text = speller(text) if speller is not None else text + split_word = speller_corrected_text.split() + spell_checker_corrected_text = ( + " ".join( + spell_checker.correction(word) + if spell_checker.correction(word) is not None + else word + for word in speller_corrected_text.split() + ) + if spell_checker is not None + else text + ) + + return spell_checker_corrected_text
+ + +
+[docs] + def find_number_of_spelling_errors(self, text, language="en"): + """ + Find the number of spelling errors in the given text using the specified language. + + Args: + text (str): The text to be checked. + language (str, optional): The language setting. Defaults to "en". + + Returns: + int: The number of spelling errors. + """ + return len(self.find_spelling_errors(text, language))
+ + +
+[docs] + def find_spelling_errors(self, text, language="en"): + """ + Find the spelling errors in the given text using the specified language. + + Args: + text (str): The text to be checked. + language (str, optional): The language setting. Defaults to "en". + + Returns: + list: A list of spelling errors. + """ + corrected_text = self.correct_text(text, language) + differences = self._find_differences(text, corrected_text) + return differences
+ + +
+[docs] + def find_number_of_grammatical_errors(self, inp_text, language="en"): + """ + Finds the number of grammatical errors in the input text. + + Args: + inp_text (str): The input text to analyze for grammatical errors. + language (str, optional): The language of the input text. Defaults to "en". + max_retries (int, optional): The maximum number of retry attempts. Defaults to 3. + + Returns: + int: The number of grammatical errors found in the input text, or None if an error occurs. + """ + + max_retries = 5 # Maximum number of retries + retry_delay = 5 # Initial delay in seconds (5 seconds) + if inp_text is None or len(inp_text) == 0: + return None + + for attempt in range(max_retries): + try: + errors = ltp.check( + inp_text, api_url="https://languagetool.org/api/v2/", lang=language + ) + return len(errors) + except Exception as e: + log.error(f"Error while finding grammatical errors: {str(e)}") + if attempt < max_retries - 1: # No need to sleep on the last attempt + log.warning( + f"Rate limit exceeded, retrying in {retry_delay} seconds..." + ) + time.sleep(retry_delay) + retry_delay *= 2 + else: + return None
+ + +
+[docs] + def translate(self, inp_text, source_lang="auto", target_lang=TARGET_LANG): + """ + Translates the input text to the target language. + + Args: + inp_text (str): The input text to translate. + source_lang (str, optional): The source language of the input text. Defaults to "auto". + target_lang (str, optional): The target language of the input text. Defaults to TARGET_LANG. + + Returns: + str: The translated text, or None if an error occurs. + """ + if inp_text is None or len(inp_text) == 0: + return None + + if source_lang == self.TARGET_LANG: + return inp_text + + try: + return GoogleTranslator(source=source_lang, target=target_lang).translate( + inp_text + ) + except Exception as e: + log.error(f"Error while translating: {str(e)}") + return None
+ + +
+[docs] + def calculate_sentiment_analysis_score(self, inp_text, lang="en"): + """ + Calculates the sentiment analysis of the input text. + + Args: + inp_text (str): The input text to analyze for sentiment analysis. + lang (str, optional): The language of the input text. Defaults to "english". + + Returns: + float: The sentiment analysis of the input text, or None if an error occurs. + """ + if inp_text is None or len(inp_text) == 0: + return None + + try: + translated_text = self.translate(inp_text, source_lang=lang) + if translated_text is None: + return None + blob = TextBlob(inp_text) + return blob.sentiment.polarity + except Exception as e: + log.error(f"Error while calculating sentiment analysis: {str(e)}") + return None
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/bdc/steps/preprocess_phonenumbers.html b/_modules/bdc/steps/preprocess_phonenumbers.html new file mode 100644 index 0000000..85872e1 --- /dev/null +++ b/_modules/bdc/steps/preprocess_phonenumbers.html @@ -0,0 +1,249 @@ + + + + + + bdc.steps.preprocess_phonenumbers — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    +
  • + + +
  • +
  • +
+
+
+
+
+ +

Source code for bdc.steps.preprocess_phonenumbers

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Fabian-Paul Utech <f.utech@gmx.net>
+
+from typing import Optional
+
+import pandas as pd
+import phonenumbers
+from phonenumbers import geocoder
+from tqdm import tqdm
+
+from bdc.steps.helpers import get_lead_hash_generator
+from bdc.steps.step import Step
+from logger import get_logger
+
+log = get_logger()
+
+
+
+[docs] +class PreprocessPhonenumbers(Step): + """ + The PreprocessPhonenumbers step will check if the provided phone numbers are valid and extract geo information + if possible. + + Attributes: + name: Name of this step, used for logging + added_cols: List of fields that will be added to the main dataframe by executing this step + required_cols: List of fields that are required to be existent in the input dataframe before performing this + step + + Added Columns: + number_formatted (str): The formatted phone number, e.g. +49 123 456789 + number_country (str): The country of the phone number, e.g. Germany + number_area (str): The area of the phone number, e.g. Berlin + number_valid (bool): Whether the phone number is valid + number_possible (bool): Whether the phone number is possible + """ + + name = "Preprocess-Phonenumbers" + added_cols = [ + "number_formatted", + "number_country", + "number_area", + "number_valid", + "number_possible", + ] + required_cols = ["Phone"] + +
+[docs] + def load_data(self): + pass
+ + +
+[docs] + def verify(self): + return super().verify()
+ + +
+[docs] + def run(self): + tqdm.pandas(desc="Preprocessing Phone numbers") + + self.df[self.added_cols] = self.df.progress_apply( + lambda lead: pd.Series( + get_lead_hash_generator().hash_check( + lead, self.process_row, self.name, self.added_cols, lead + ) + ), + axis=1, + ) + + # self.df[self.added_cols] = self.df.progress_apply( + # lambda lead: pd.Series(self.process_row(lead)), axis=1 + # ) + + return self.df
+ + +
+[docs] + def process_row(self, row): + return self.check_number("+" + str(row["Phone"])) or { + key: False if "valid" in key or "possible" in key else "" + for key in self.added_cols + }
+ + +
+[docs] + def finish(self): + p_phone_numbers = self.df["number_valid"].sum() / len(self.df) * 100 + log.info(f"Percentage of valid numbers: {p_phone_numbers}%")
+ + +
+[docs] + def check_number(self, phone_number: str) -> Optional[str]: + try: + phone_number_object = phonenumbers.parse(phone_number, None) + except Exception as e: + log.error(str(e)) + return None + + country_code = phonenumbers.format_number( + phone_number_object, phonenumbers.PhoneNumberFormat.INTERNATIONAL + ).split(" ")[0] + international_number = phonenumbers.format_number( + phone_number_object, phonenumbers.PhoneNumberFormat.INTERNATIONAL + ) + + # Set country based on country code (Norway and Finland not working properly, thats why they are defined separetly) + country = {"+358": "Finland", "+47": "Norway"}.get( + country_code, geocoder.country_name_for_number(phone_number_object, "en") + ) + + location = geocoder.description_for_number(phone_number_object, "en") + location = "" if location == country else location + + # Valid number (e.g., it's in an assigned exchange) + is_valid_number = phonenumbers.is_valid_number(phone_number_object) + + # Possible number (e.g., it has the right number of digits) + is_possible_number = phonenumbers.is_possible_number(phone_number_object) + + results = [ + international_number, + country, + location, + is_valid_number, + is_possible_number, + ] + + result_dict = {col: val for (col, val) in zip(self.added_cols, results)} + + return result_dict
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/bdc/steps/regionalatlas.html b/_modules/bdc/steps/regionalatlas.html new file mode 100644 index 0000000..d6db510 --- /dev/null +++ b/_modules/bdc/steps/regionalatlas.html @@ -0,0 +1,432 @@ + + + + + + bdc.steps.regionalatlas — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for bdc.steps.regionalatlas

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Felix Zailskas <felixzailskas@gmail.com>
+# SPDX-FileCopyrightText: 2023 Fabian-Paul Utech <f.utech@gmx.net>
+
+
+import geopandas as gpd
+import osmnx
+import pandas as pd
+from pandas import DataFrame
+from tqdm import tqdm
+
+from bdc.steps.helpers import get_lead_hash_generator
+from bdc.steps.step import Step, StepError
+from logger import get_logger
+
+log = get_logger()
+
+
+
+[docs] +class RegionalAtlas(Step): + """ + The RegionalAtlas step will query the RegionalAtlas database for location based geographic and demographic + information, based on the address that was found for a business (currently through Google API) or the + area provided by the phonenumber (preprocess_phonenumbers.py). + + Attributes: + name: Name of this step, used for logging + reagionalatlas_feature_keys: Dictionary to translate between the keys in the merged.geojson and the used column names in the df + df_fields: the keys of the merged.geojson + added_cols: List of fields that will be added to the main dataframe by executing this step + required_cols: List of fields that are required in the input dataframe before performing this step + + regions_gdfs: dataframe that includes all keys/values from the merged.geojson + empty_result: empty result that will be used in case there are problems with the data + epsg_code_etrs: 25832 is the standard used by RegionAtlas + + Added Columns: + pop_density (float): Population density of the searched city + pop_development (float): Population development of the searched city + age_0 (float): Population age group 0-18 of the searched city + age_1 (float): Population age group 18-30 of the searched city + age_2 (float): Population age group 30-45 of the searched city + age_3 (float): Population age group 45-60 of the searched city + age_4 (float): Population age group 60+ of the searched city + pop_avg_age (float): Average age of the searched city + per_service_sector (float): Percentage of the service sector of the searched city + per_trade (float): Percentage of the trade sector of the searched city + employment_rate (float): Employment rate of the searched city + unemployment_rate (float): Unemployment rate of the searched city + per_long_term_unemployment (float): Percentage of long term unemployment of the searched city + investments_p_employee (float): Investments per employee of the searched city + gross_salary_p_employee (float): Gross salary per employee of the searched city + disp_income_p_inhabitant (float): Disposable income per inhabitant of the searched city + tot_income_p_taxpayer (float): Total income per taxpayer of the searched city + gdp_p_employee (float): GDP per employee of the searched city + gdp_development (float): GDP development of the searched city + gdp_p_inhabitant (float): GDP per inhabitant of the searched city + gdp_p_workhours (float): GDP per workhour of the searched city + pop_avg_age_zensus (float): Average age of the searched city (zensus) + unemployment_rate (float): Unemployment rate of the searched city (zensus) + regional_score (float): Regional score of the searched city + """ + + name: str = "Regional_Atlas" + reagionalatlas_feature_keys: dict = { + "pop_density": "ai0201", + "pop_development": "ai0202", + "age_0": "ai0203", + "age_1": "ai0204", + "age_2": "ai0205", + "age_3": "ai0206", + "age_4": "ai0207", + "pop_avg_age": "ai0218", + "per_service_sector": "ai0706", + "per_trade": "ai0707", + "employment_rate": "ai0710", + "unemployment_rate": "ai0801", + "per_long_term_unemployment": "ai0808", + "investments_p_employee": "ai1001", + "gross_salary_p_employee": "ai1002", + "disp_income_p_inhabitant": "ai1601", + "tot_income_p_taxpayer": "ai1602", + "gdp_p_employee": "ai1701", + "gdp_development": "ai1702", + "gdp_p_inhabitant": "ai1703", + "gdp_p_workhours": "ai1704", + "pop_avg_age_zensus": "ai_z01", + "unemployment_rate": "ai_z08", + } + + df_fields: list[str] = reagionalatlas_feature_keys.values() + + # Weirdly the expression [f"{name}_{field}" for field in df_fields] gives an error as name is not in the scope of the iterator + added_cols = [ + name + field + for (name, field) in zip( + [f"{name.lower()}_"] * (len(df_fields)), + ([f"{field}" for field in reagionalatlas_feature_keys.keys()]), + ) + ] + [f"{name.lower()}_regional_score"] + + required_cols = ["google_places_formatted_address"] + + regions_gdfs = gpd.GeoDataFrame() + empty_result: dict = dict.fromkeys(reagionalatlas_feature_keys.values()) + + # Adjust the EPSG code from the osmnx search query to the regionalatlas specific code + # epsg_code 4326 [WGS 84 (used by osmnx)]=> epsg_code_etrs = 25832 [ETRS89 / UTM zone 32N (used by regionalatlas)] + epsg_code_etrs = 25832 + +
+[docs] + def load_data(self) -> None: + pass
+ + +
+[docs] + def verify(self) -> bool: + # Load the data file + try: + self.regions_gdfs = gpd.read_file("data/merged_geo.geojson") + except: + raise StepError( + "The path for the geojson for regional information (Regionalatlas) is not valid!" + ) + return super().verify()
+ + +
+[docs] + def run(self) -> DataFrame: + tqdm.pandas(desc="Getting social data") + + # Add the new fields to the df + self.df[self.added_cols[:-1]] = self.df.progress_apply( + lambda lead: pd.Series( + get_lead_hash_generator().hash_check( + lead, + self.get_data_from_address, + self.name + "_Location-Data", + self.added_cols[:-1], + lead, + ) + ), + axis=1, + ) + + # self.df[self.added_cols[:-1]] = self.df.progress_apply( + # lambda lead: pd.Series(self.get_data_from_address(lead)), axis=1 + # ) + + tqdm.pandas(desc="Computing Regional Score") + + self.df[self.added_cols[-1:]] = self.df.progress_apply( + lambda lead: pd.Series( + get_lead_hash_generator().hash_check( + lead, + self.calculate_regional_score, + self.name + "_Regional-Score", + self.added_cols[-1:], + lead, + ) + ), + axis=1, + ) + return self.df
+ + +
+[docs] + def finish(self) -> None: + success_rate = ( + 1 + - self.df["regional_atlas_pop_density"].isna().sum() + / len(self.df["regional_atlas_pop_density"]) + ) * 100 + log.info( + "Percentage of regional information (germany): {:.2f}%".format( + round(success_rate, 2) + ) + )
+ + +
+[docs] + def get_data_from_address(self, row): + """ + Retrieve the regional features for every lead. Every column of reagionalatlas_feature_keys is added. + + Based on the google places address or the phonenumber area. Checks if the centroid of the + searched city is in a RegionalAtlas region. + + Possible extensions could include: + - More RegionalAtlas features + + :param row: Lead for which to retrieve the features + + :return: dict - The retrieved features if the necessary fields are present for the lead. Empty dictionary otherwise. + """ + + # can only get an result if we know the region + if ( + row["google_places_formatted_address"] is None + and row["number_area"] is None + ): + return self.empty_result + + country = "" + + # the phone number has secondary priority (because it can be a private number), therefore can be overwritten by the google places information + if row["number_country"] is not None: + country = row["number_country"] + + if row["google_places_formatted_address"] is not None: + google_location = str(row["google_places_formatted_address"]).split(",")[ + -2: + ] + google_location = [name.strip() for name in google_location] + country = google_location[-1].lower() + + # the 'regionalatlas' data is specific to germany + if country not in [ + "deutschland", + "germany", + "allemagne", + "tyskland", + "germania", + ]: + return self.empty_result + + """#Alternative to the if 'if country not in ...' + if not self.germany_gdf.intersects(row_gdf): + return self.empty_result""" + + # Get the polygon of the city, to find the corresponding region + try: + if row["google_places_formatted_address"] is not None: + search_gdf = osmnx.geocode_to_gdf(",".join(google_location)) + else: # at this point we know, that either a google_places_address exists or a number_area + search_gdf = osmnx.geocode_to_gdf(row["number_area"]) + except: + log.info("Google location not found!") + return self.empty_result + + search_gdf_reprojected = search_gdf.to_crs("EPSG:" + str(self.epsg_code_etrs)) + + # Use the centroid of the city, to check if a region + search_centroid = search_gdf_reprojected.centroid + + area_key = None + + return_values = {} + + # go through all regions of germany ... + for idx, region in self.regions_gdfs.iterrows(): + if area_key is not None: + if region["schluessel"] != area_key: + continue + else: + return_values.update( + region[self.reagionalatlas_feature_keys.values()].to_dict() + ) + break + else: + region_polygon = region["geometry"] + b_contains = region_polygon.contains(search_centroid).item() + + if b_contains: + area_key = region["schluessel"] + return_values.update( + region[self.reagionalatlas_feature_keys.values()].to_dict() + ) + break + + return return_values
+ + +
+[docs] + def calculate_regional_score(self, lead) -> float | None: + """ + Calculate a regional score for a lead based on information from the RegionalAtlas API. + + This function uses population density, employment rate, and average income to compute + the buying power of potential customers in the area in millions of euro. + + The score is computed as: + (population density * employment rate * average income) / 1,000,000 + + Possible extensions could include: + - Population age groups + + :param lead: Lead for which to compute the score + + :return: float | None - The computed score if the necessary fields are present for the lead. None otherwise. + """ + + pop_density_col = f"{self.name.lower()}_pop_density" + employment_rate_col = f"{self.name.lower()}_employment_rate" + income_col = f"{self.name.lower()}_disp_income_p_inhabitant" + + pop_density = lead[pop_density_col] + employment_rate = lead[employment_rate_col] + income_per_inhabitant = lead[income_col] + + pop_density = pop_density if pd.notnull(pop_density) else 0 + employment_rate = employment_rate if pd.notnull(employment_rate) else 0 + income_per_inhabitant = ( + income_per_inhabitant if pd.notnull(income_per_inhabitant) else 0 + ) + + regional_score = ( + pop_density * employment_rate * income_per_inhabitant + ) / 1000000 + + if pd.notnull(regional_score): + return regional_score + else: + raise ValueError("Regional score is null")
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/bdc/steps/search_offeneregister.html b/_modules/bdc/steps/search_offeneregister.html new file mode 100644 index 0000000..3a28f10 --- /dev/null +++ b/_modules/bdc/steps/search_offeneregister.html @@ -0,0 +1,251 @@ + + + + + + bdc.steps.search_offeneregister — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    +
  • + + +
  • +
  • +
+
+
+
+
+ +

Source code for bdc.steps.search_offeneregister

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Berkay Bozkurt <resitberkaybozkurt@gmail.com>
+
+import pandas as pd
+from pandas import DataFrame
+from tqdm import tqdm
+
+from bdc.steps.helpers import OffeneRegisterAPI, get_lead_hash_generator
+from bdc.steps.step import Step
+from logger import get_logger
+
+log = get_logger()
+
+
+
+[docs] +class SearchOffeneRegister(Step): + """ + This class represents a step in the sales lead qualification process that searches for company-related data + using the OffeneRegisterAPI. + + Attributes: + name (str): The name of the step. + required_cols (list): The list of required columns in the input DataFrame. + added_cols (list): The list of columns to be added to the input DataFrame. + offeneregisterAPI (OffeneRegisterAPI): An instance of the OffeneRegisterAPI class. + + Methods: + verify(): Verifies if the step is ready to run. + finish(): Performs any necessary cleanup or finalization steps. + load_data(): Loads any required data for the step. + run(): Executes the step and returns the modified DataFrame. + _extract_company_related_data(lead): Extracts company-related data for a given lead. + + Added Columns: + company_name (str): The name of the company from offeneregister.de + company_objective (str): The objective of the company offeneregister.de + company_capital (float): The capital of the company offeneregister.de + company_capital_currency (str): The currency of the company capital offeneregister.de + company_address (str): The address of the company offeneregister.de + """ + + name = "OffeneRegister" + required_cols = ["Last Name", "First Name"] + added_cols = [ + "company_name", + "company_objective", + "company_capital", + "company_capital_currency", + "compan_address", + ] + offeneregisterAPI = OffeneRegisterAPI() + +
+[docs] + def verify(self) -> bool: + return super().verify()
+ + +
+[docs] + def finish(self): + log.info("Search Offeneregister finished with the summary below:") + for col in self.added_cols: + col_perc = self.df[col].notna().sum() / len(self.df[col]) * 100 + log.info(f"Percentage of {col} (of all): {col_perc:.2f}%")
+ + +
+[docs] + def load_data(self): + pass
+ + +
+[docs] + def run(self) -> DataFrame: + tqdm.pandas(desc="Running Search Offeneregister for company related data...") + + self.df[self.added_cols] = self.df.progress_apply( + lambda lead: pd.Series( + get_lead_hash_generator().hash_check( + lead, + self._extract_company_related_data, + self.name, + self.added_cols, + lead, + ) + ), + axis=1, + ) + return self.df
+ + + +
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/bdc/steps/step.html b/_modules/bdc/steps/step.html new file mode 100644 index 0000000..ec71dca --- /dev/null +++ b/_modules/bdc/steps/step.html @@ -0,0 +1,226 @@ + + + + + + bdc.steps.step — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for bdc.steps.step

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Lucca Baumgärtner <lucca.baumgaertner@fau.de>
+# SPDX-FileCopyrightText: 2023 Felix Zailskas <felixzailskas@gmail.com>
+
+from pandas import DataFrame
+
+from logger import get_logger
+
+log = get_logger()
+
+
+
+[docs] +class StepError(Exception): + pass
+ + + +
+[docs] +class Step: + """ + Step is an abstract parent class for all steps of the data enrichment pipeline. Steps can be added to a list + and then be passed to the pipeline for sequential execution. + + Attributes: + name: Name of this step, used for logging and as column prefix + added_cols: List of fields that will be added to the main dataframe by executing a step + required_cols: List of fields that are required to be existent in the input dataframe before performing a step + """ + + name: str = None + added_cols: list[str] = [] + required_cols: list[str] = [] + + def __init__(self, force_refresh: bool = False) -> None: + self.df = None + self.force_refresh = force_refresh + + @property + def df(self) -> DataFrame: + return self._df + + @df.setter + def df(self, df) -> None: + self._df = df + +
+[docs] + def load_data(self) -> None: + """ + Load data for this processing step. This could be an API call or reading from a CSV file. Can also be empty + if self.df is used. + """ + raise NotImplementedError
+ + +
+[docs] + def verify(self) -> bool: + """ + Verify that the data has been loaded correctly and is present in a format that can be processed by this step. + If this fails, run() and finish() will not be executed. + """ + return self.df is not None and all( + column in self.df for column in self.required_cols + )
+ + +
+[docs] + def check_data_presence(self) -> bool: + """ + Check whether the data this step collects is already present in the df. + Can be forced to return False if self._force_execution is set to True. + """ + if len(self.added_cols) == 0: + log.warning( + "Warning trying to check for data presence without setting self.added_cols!", + ) + if self.force_refresh: + log.info("Data refresh was forced") + return False + data_present = all([col in self._df for col in self.added_cols]) + if data_present: + log.info(f"Data is present. Not running step.") + else: + log.info(f"Data is not present. Fetching through step logic...") + return data_present
+ + +
+[docs] + def run(self) -> DataFrame: + """ + Perform the actual processing step. Will not be executed if verify() fails. + + :raises: StepError + """ + raise NotImplementedError
+ + +
+[docs] + def finish(self) -> None: + """ + Finish the execution. Print a report or clean up temporary files. Will not be executed if verify() fails. + """ + raise NotImplementedError
+ + + def __str__(self) -> str: + return f"Step(Name: {self.name}, Force Refresh: {self.force_refresh}, Added Columns: {self.added_cols})" + + def __repr__(self) -> str: + return f"Step(name='{self.name}', force_refresh={self.force_refresh})"
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/database.html b/_modules/database.html new file mode 100644 index 0000000..bf0eee3 --- /dev/null +++ b/_modules/database.html @@ -0,0 +1,136 @@ + + + + + + database — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for database

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Felix Zailskas <felixzailskas@gmail.com>
+
+from config import DATABASE_TYPE
+from logger import get_logger
+
+from .leads import LocalRepository, Repository, S3Repository
+
+_database = None
+log = get_logger()
+
+
+
+[docs] +def get_database() -> Repository: + global _database + if _database is None: + if DATABASE_TYPE == "S3": + _database = S3Repository() + elif DATABASE_TYPE == "Local": + _database = LocalRepository() + else: + log.error("Database type not initialised") + raise ValueError + + return _database
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/database/leads/local_repository.html b/_modules/database/leads/local_repository.html new file mode 100644 index 0000000..b0839de --- /dev/null +++ b/_modules/database/leads/local_repository.html @@ -0,0 +1,446 @@ + + + + + + database.leads.local_repository — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for database.leads.local_repository

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Sophie Heasman <sophieheasmann@gmail.com>
+
+import csv
+import json
+import os
+from pathlib import Path
+
+import joblib
+import pandas as pd
+
+from logger import get_logger
+
+from .repository import Repository
+
+log = get_logger()
+
+
+
+[docs] +class LocalRepository(Repository): + BASE_PATH = os.path.dirname(__file__) + DF_INPUT = os.path.abspath( + os.path.join(BASE_PATH, "../../data/sumup_leads_email.csv") + ) + DF_OUTPUT = os.path.abspath( + os.path.join(BASE_PATH, "../../data/leads_enriched.csv") + ) + DF_HISTORICAL_OUTPUT = os.path.abspath( + os.path.join(BASE_PATH, "../../data/100k_historic_enriched.csv") + ) + DF_PREPROCESSED_INPUT = os.path.abspath( + os.path.join(BASE_PATH, "../../data/preprocessed_data_files/") + ) + DF_PREDICTION_OUTPUT = os.path.abspath( + os.path.join(BASE_PATH, "../../data/leads_predicted_size.csv") + ) + REVIEWS = os.path.abspath(os.path.join(BASE_PATH, "../../data/reviews/")) + SNAPSHOTS = os.path.abspath(os.path.join(BASE_PATH, "../../data/snapshots/")) + GPT_RESULTS = os.path.abspath(os.path.join(BASE_PATH, "../../data/gpt-results/")) + ML_MODELS = os.path.abspath(os.path.join(BASE_PATH, "../../data/models/")) + CLASSIFICATION_REPORTS = os.path.abspath( + os.path.join(BASE_PATH, "../../data/classification_reports/") + ) + + def _download(self): + """ + Download database from specified DF path + """ + try: + self.df = pd.read_csv(self.DF_INPUT) + except FileNotFoundError: + log.error("Error: Could not find input file for Pipeline.") + +
+[docs] + def save_dataframe(self): + """ + Save dataframe in df attribute in chosen output location + """ + self.df.to_csv(self.DF_OUTPUT, index=False) + log.info(f"Saved enriched data locally to {self.DF_OUTPUT}")
+ + +
+[docs] + def save_prediction(self, df): + """ + Save dataframe in df parameter in chosen output location + """ + df.to_csv(self.DF_PREDICTION_OUTPUT, index=False) + log.info(f"Saved prediction result locally to {self.DF_PREDICTION_OUTPUT}")
+ + +
+[docs] + def insert_data(self, data): + """ + TODO: Insert new data into specified dataframe + :param data: Data to be inserted (desired format must be checked) + """ + pass
+ + +
+[docs] + def save_review(self, review, place_id, force_refresh=False): + """ + Upload review to specified review path + :param review: json contents of the review to be uploaded + """ + # Write the data to a JSON file + file_name = place_id + "_gpt_results.json" + json_file_path = os.path.join(self.REVIEWS, file_name) + + if os.path.exists(json_file_path): + log.debug(f"Reviews for {place_id} already exist") + return + + with open(json_file_path, "w", encoding="utf-8") as json_file: + json.dump(review, json_file, ensure_ascii=False, indent=4)
+ + +
+[docs] + def fetch_review(self, place_id): + """ + Fetch review for specified place_id + :return: json contents of desired review + """ + file_name = place_id + "_gpt_results.json" + reviews_path = os.path.join(self.REVIEWS, file_name) + try: + with open(reviews_path, "r", encoding="utf-8") as reviews_json: + reviews = json.load(reviews_json) + return reviews + except: + log.warning(f"Error loading reviews from path {reviews_path}.") + # Return empty list if any exception occurred or status is not OK + return []
+ + +
+[docs] + def create_snapshot(self, df, prefix, name): + full_path = ( + f"{self.SNAPSHOTS}/{prefix.replace('/','_')}{name.lower()}_snapshot.csv" + ) + df.to_csv(full_path, index=False)
+ + +
+[docs] + def clean_snapshots(self, prefix): + pass
+ + +
+[docs] + def save_lookup_table(self, lookup_table: dict, step_name: str) -> None: + lookup_path = Path( + self.BASE_PATH + f"/../../data/lookup_tables/{step_name}.csv" + ) + with open(str(lookup_path), mode="w", newline="", encoding="utf-8") as fh: + csv_writer = csv.writer(fh) + csv_writer.writerow( + [ + "HashedData", + "First Name", + "Last Name", + "Company / Account", + "Phone", + "Email", + "Last Updated", + ] + ) # Write the header + + for hashed_data, other_columns in lookup_table.items(): + csv_writer.writerow([hashed_data] + other_columns)
+ + +
+[docs] + def load_lookup_table(self, step_name: str) -> dict: + lookup_path = Path( + self.BASE_PATH + f"/../../data/lookup_tables/{step_name}.csv" + ) + if not lookup_path.resolve().parent.exists(): + lookup_path.resolve().parent.mkdir(parents=True, exist_ok=True) + lookup_table = {} + try: + with open(str(lookup_path), mode="r", encoding="utf-8") as fh: + csv_reader = csv.reader(fh) + headers = next(csv_reader) # Read the header row + + for row in csv_reader: + hashed_data = row[0] + other_columns = row[1:] + lookup_table[hashed_data] = other_columns + except FileNotFoundError: + # if the file is not present then there is no lookup table => return empty dict + pass + + return lookup_table
+ + +
+[docs] + def save_gpt_result(self, gpt_result, file_id, operation_name, force_refresh=False): + """ + Save the results of GPT operations to a specified path + :param gpt_results: The results of the GPT operations to be saved + :param operation_name: The name of the GPT operation + :param save_date: The date the results were saved + """ + file_name = file_id + "_gpt_results.json" + json_file_path = os.path.join(self.GPT_RESULTS, file_name) + + current_date = self._get_current_time_as_string() + if os.path.exists(json_file_path): + with open(json_file_path, "r", encoding="utf-8") as json_file: + existing_data = json.load(json_file) + + existing_data[operation_name] = { + "result": gpt_result, + "last_update_date": current_date, + } + + with open(json_file_path, "w", encoding="utf-8") as json_file: + json.dump(existing_data, json_file, ensure_ascii=False, indent=4) + else: + with open(json_file_path, "w", encoding="utf-8") as json_file: + json.dump( + { + operation_name: { + "result": gpt_result, + "last_update_date": current_date, + } + }, + json_file, + ensure_ascii=False, + indent=4, + )
+ + +
+[docs] + def fetch_gpt_result(self, file_id, operation_name): + """ + Fetches the GPT result for a given file ID and operation name. + + Args: + file_id (str): The ID of the file. + operation_name (str): The name of the GPT operation. + + Returns: + The GPT result for the specified file ID and operation name. + """ + file_name = file_id + "_gpt_results.json" + json_file_path = os.path.join(self.GPT_RESULTS, file_name) + if not os.path.exists(json_file_path): + return "" + try: + with open(json_file_path, "r", encoding="utf-8") as json_file: + data = json.load(json_file) + if operation_name not in data: + log.info( + f"Data for operation {operation_name} was not found in {json_file_path}" + ) + return "" + return data[operation_name] + except: + log.warning(f"Error loading GPT results from path {json_file_path}.") + # Return empty string if any exception occurred or status is not OK + return ""
+ + +
+[docs] + def load_ml_model(self, model_name: str): + model_file_path = os.path.join(self.ML_MODELS, model_name) + try: + model = joblib.load(open(model_file_path, "rb")) + except FileNotFoundError: + log.error(f"Could not find model file {model_file_path}") + model = None + + return model
+ + +
+[docs] + def save_ml_model(self, model, model_name: str): + if not os.path.exists(self.ML_MODELS): + Path(self.ML_MODELS).mkdir(parents=True, exist_ok=True) + model_file_path = os.path.join(self.ML_MODELS, model_name) + if os.path.exists(model_file_path): + log.warning(f"Overwriting model at {model_file_path}") + try: + joblib.dump(model, open(model_file_path, "wb")) + except Exception as e: + log.error(f"Could not save model at {model_file_path}! Error: {str(e)}")
+ + +
+[docs] + def load_classification_report(self, model_name: str): + report_file_path = os.path.join( + self.CLASSIFICATION_REPORTS, "report_" + model_name + ) + try: + report = joblib.load(open(report_file_path, "rb")) + except FileNotFoundError: + log.error(f"Could not find report file {report_file_path}") + report = None + + return report
+ + +
+[docs] + def save_classification_report(self, report, model_name: str): + if not os.path.exists(self.CLASSIFICATION_REPORTS): + Path(self.CLASSIFICATION_REPORTS).mkdir(parents=True, exist_ok=True) + report_file_path = os.path.join( + self.CLASSIFICATION_REPORTS, "report_" + model_name + ) + if os.path.exists(report_file_path): + log.warning(f"Overwriting report at {report_file_path}") + try: + joblib.dump(report, open(report_file_path, "wb")) + except Exception as e: + log.error(f"Could not save report at {report_file_path}! Error: {str(e)}")
+ + +
+[docs] + def get_preprocessed_data_path(self, historical: bool = True): + file_name = ( + "historical_preprocessed_data.csv" + if historical + else "preprocessed_data.csv" + ) + file_path = os.path.join(self.DF_PREPROCESSED_INPUT, file_name) + return file_path
+ + +
+[docs] + def load_preprocessed_data(self, historical: bool = True): + try: + return pd.read_csv(self.get_preprocessed_data_path(historical)) + except FileNotFoundError: + log.error("Error: Could not find input file for preprocessed data.")
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/database/leads/repository.html b/_modules/database/leads/repository.html new file mode 100644 index 0000000..33ad0ed --- /dev/null +++ b/_modules/database/leads/repository.html @@ -0,0 +1,429 @@ + + + + + + database.leads.repository — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for database.leads.repository

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Sophie Heasman <sophieheasmann@gmail.com>
+
+from abc import ABC, abstractmethod
+from datetime import datetime
+
+
+
+[docs] +class Repository(ABC): + DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S" + + # Database paths for dataframe and reviews have to be set + @property + @abstractmethod + def DF_INPUT(self): + """ + Define database path to load dataframe + """ + pass + + @property + @abstractmethod + def DF_OUTPUT(self): + """ + Define database path to store dataframe + """ + pass + + @property + @abstractmethod + def DF_HISTORICAL_OUTPUT(self): + """ + Define database path to store historical enriched dataframe (used for preprocessing input) + """ + pass + + @property + @abstractmethod + def REVIEWS(self): + """ + Define database path to store reviews + """ + pass + + @property + @abstractmethod + def SNAPSHOTS(self): + """ + Define database path to store snapshots + """ + pass + + @property + @abstractmethod + def GPT_RESULTS(self): + """ + Define database path to store GPT operations + """ + pass + + def __init__(self): + """ + Initialise DAL, and saves the input df as an attribute + :param download_df: Specify if you want to download the dataframe in this instance (not needed when handling reviews) + """ + self.df = None + self._download() + +
+[docs] + def get_dataframe(self): + return self.df
+ + +
+[docs] + def set_dataframe(self, df): + self.df = df
+ + +
+[docs] + def get_input_path(self): + return self.DF_INPUT
+ + +
+[docs] + def get_enriched_data_path(self, historical=False): + if historical: + return self.DF_HISTORICAL_OUTPUT + return self.DF_OUTPUT
+ + + @abstractmethod + def _download(self): + """ + Download database from specified DF path + """ + pass + +
+[docs] + @abstractmethod + def save_dataframe(self): + """ + Save dataframe in df attribute in chosen output location + """ + pass
+ + +
+[docs] + @abstractmethod + def save_prediction(self, df): + """ + Save dataframe in df parameter in chosen output location + """ + pass
+ + +
+[docs] + @abstractmethod + def insert_data(self, data): + """ + Insert new data into specified dataframe + :param data: Data to be inserted (desired format must be checked) + """ + pass
+ + +
+[docs] + @abstractmethod + def create_snapshot(self, df, prefix, name): + """ + Snapshot the current state of the dataframe + :param df: Data to create a snapshot of + :param prefix: Prefix for a group of snapshots belonging to a singe pipeline run, used to identify snapshots + when cleaning up after a pipeline run + :param name: Name of the snapshot + :return: None + """
+ + +
+[docs] + @abstractmethod + def clean_snapshots(self, prefix): + """ + Clean up the snapshots after a pipeline ran successfully + :param prefix: Prefix of the current pipeline run used to identify all snapshots to delete + """
+ + +
+[docs] + @abstractmethod + def save_review(self, review, place_id, force_refresh=False): + """ + Upload review to specified review path + :param review: json contents of the review to be uploaded + """ + pass
+ + +
+[docs] + @abstractmethod + def fetch_review(self, place_id): + """ + Fetch review for specified place_id + :return: json contents of desired review + """ + pass
+ + +
+[docs] + @abstractmethod + def save_lookup_table(self, lookup_table: dict, step_name: str) -> None: + """ + Save the lookup table for hashes for a given step + """ + pass
+ + +
+[docs] + @abstractmethod + def fetch_gpt_result(self, file_id, operation_name): + """ + Fetches the GPT result for a given file ID and operation name. + + Args: + file_id (str): The ID of the file. + operation_name (str): The name of the GPT operation. + + Returns: + The GPT result for the specified file ID and operation name. + """ + pass
+ + +
+[docs] + @abstractmethod + def load_lookup_table(self, step_name: str) -> dict: + """ + Create or load the lookup table of hashes for a given step + :return: lookup table as a pandas DataFrame + """ + pass
+ + +
+[docs] + @abstractmethod + def save_gpt_result(self, gpt_result, file_id, operation_name, force_refresh=False): + """ + Saves the GPT result for a given file ID and operation name. + + Args: + gpt_result (str): The GPT result to be saved. + file_id (str): The ID of the file. + operation_name (str): The name of the operation. + force_refresh (bool, optional): Whether to force a refresh of the saved result. Defaults to False. + """ + pass
+ + + def _get_current_time_as_string(self): + """ + Get the current time as a string + """ + return datetime.now().strftime(self.DATETIME_FORMAT) + + def _convert_string_time_to_datetime(self, time): + """ + Convert a string time to a datetime object + """ + return datetime.strptime(time, self.DATETIME_FORMAT) + +
+[docs] + @abstractmethod + def load_ml_model(self, model_name: str): + """ + Load a ML model from a file with a given name + + Args: + model_name (str): File name + """ + pass
+ + +
+[docs] + @abstractmethod + def save_ml_model(self, model, model_name: str): + """ + Save a given ML model to a file with a given name + + Args: + model: Model to save + model_name (str): File name + """ + pass
+ + +
+[docs] + @abstractmethod + def load_classification_report(self, model_name: str): + """ + Load a given classification report to a file with a given name + + Args: + model_name (str): Model name that created the report + """ + pass
+ + +
+[docs] + @abstractmethod + def save_classification_report(self, report, model_name: str): + """ + Save a given classification report to a file with a given name + + Args: + report: The classification report to save + model_name (str): Model name that created the report + """ + pass
+ + +
+[docs] + @abstractmethod + def get_preprocessed_data_path(self, historical: bool = True): + """ + Returns the path for a preprocessed data file (either historical or current) + """ + pass
+ + +
+[docs] + @abstractmethod + def load_preprocessed_data(self, historical: bool = True): + """ + Load the preprocessed data from the given file + """ + pass
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/database/leads/s3_repository.html b/_modules/database/leads/s3_repository.html new file mode 100644 index 0000000..94495d3 --- /dev/null +++ b/_modules/database/leads/s3_repository.html @@ -0,0 +1,590 @@ + + + + + + database.leads.s3_repository — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for database.leads.s3_repository

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Sophie Heasman <sophieheasmann@gmail.com>
+
+import csv
+import hashlib
+import json
+import tempfile
+from datetime import datetime
+from io import StringIO
+
+import boto3
+import botocore.exceptions
+import joblib
+import pandas as pd
+
+from config import AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
+from logger import get_logger
+
+from .repository import Repository
+
+log = get_logger()
+s3 = boto3.client(
+    "s3",
+    aws_access_key_id=AWS_ACCESS_KEY_ID,
+    aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
+)
+
+
+
+[docs] +def decode_s3_url(url): + """ + Retrieve the bucket and object key from object url + :return: bucket string, object key string + """ + obj_identifier = url.split("//")[1].split("/") + bucket = obj_identifier[0] + obj_key = "/".join(obj_identifier[1:]) + return bucket, obj_key
+ + + +
+[docs] +class S3Repository(Repository): + EVENTS_BUCKET = "amos--data--events" + FEATURES_BUCKET = "amos--data--features" + MODELS_BUCKET = "amos--models" + DF_INPUT = f"s3://{EVENTS_BUCKET}/leads/enriched.csv" + DF_OUTPUT = f"s3://{EVENTS_BUCKET}/leads/enriched.csv" + DF_HISTORICAL_OUTPUT = ( + f"s3://{EVENTS_BUCKET}/historical_data/100k_historic_enriched.csv" + ) + DF_PREDICTION_OUTPUT = f"s3://{EVENTS_BUCKET}/leads/leads_predicted_size.csv" + DF_PREPROCESSED_INPUT = f"s3://{FEATURES_BUCKET}/preprocessed_data_files/" + REVIEWS = f"s3://{EVENTS_BUCKET}/reviews/" + SNAPSHOTS = f"s3://{EVENTS_BUCKET}/snapshots/" + LOOKUP_TABLES = f"s3://{EVENTS_BUCKET}/lookup_tables/" + GPT_RESULTS = f"s3://{EVENTS_BUCKET}/gpt-results/" + ML_MODELS = f"s3://{MODELS_BUCKET}/models/" + CLASSIFICATION_REPORTS = f"s3://{MODELS_BUCKET}/classification_reports/" + + def _download(self): + """ + Download database from specified DF path + """ + if not self.DF_INPUT.startswith("s3://") or not self.DF_OUTPUT.startswith( + "s3://" + ): + log.error( + "S3 location has to be defined like this: s3://<BUCKET>/<OBJECT_KEY>" + ) + return + + source = None + remote_dataset = None + + try: + bucket, obj_key = decode_s3_url(self.DF_INPUT) + remote_dataset = self._fetch_object_s3(bucket, obj_key) + except IndexError: + log.error( + "S3 location has to be defined like this: s3://<BUCKET>/<OBJECT_KEY>" + ) + + if remote_dataset is None or "Body" not in remote_dataset: + log.error(f"Couldn't find dataset in S3 bucket {bucket} and key {obj_key}") + return + else: + source = remote_dataset["Body"] + + try: + self.df = pd.read_csv(source) + except FileNotFoundError: + log.error("Error: Could not find input file for Pipeline.") + + def _fetch_object_s3(self, bucket, obj_key): + """ + Tries to read an object from S3. + :return: s3 object + """ + obj = None + try: + obj = s3.get_object(Bucket=bucket, Key=obj_key) + except botocore.exceptions.ClientError as e: + log.warning( + f"{e.response['Error']['Code']}: {e.response['Error']['Message']} (s3://{bucket}/{obj_key})" + if "Error" in e.response + else f"Error while getting object s3://{bucket}/{obj_key}" + ) + + return obj + + def _is_object_exists_on_S3(self, bucket, key): + try: + s3.head_object(Bucket=bucket, Key=key) + return True + except Exception as e: + return False + + def _load_from_s3(self, bucket, key): + """ + Load a file from S3 + :param bucket: The name of the S3 bucket + :param key: The key of the object in the S3 bucket + :return: The contents of the file + """ + response = s3.get_object(Bucket=bucket, Key=key) + file_content = response["Body"].read().decode("utf-8") + return file_content + +
+[docs] + def save_dataframe(self): + """ + Save dataframe in df attribute in chosen output location + """ + bucket, obj_key = decode_s3_url(self.DF_OUTPUT) + self._backup_data() + csv_buffer = StringIO() + self.df.to_csv(csv_buffer, index=False) + self._save_to_s3(csv_buffer.getvalue(), bucket, obj_key) + log.info(f"Successfully saved enriched leads to s3://{bucket}/{obj_key}")
+ + +
+[docs] + def save_prediction(self, df): + """ + Save dataframe in df parameter in chosen output location + """ + bucket, obj_key = decode_s3_url(self.DF_PREDICTION_OUTPUT) + csv_buffer = StringIO() + df.to_csv(csv_buffer, index=False) + self._save_to_s3(csv_buffer.getvalue(), bucket, obj_key) + log.info(f"Successfully saved prediction result to s3://{bucket}/{obj_key}")
+ + + def _save_to_s3(self, data, bucket, key): + s3.put_object( + Bucket=bucket, + Key=key, + Body=data, + ) + + def _backup_data(self): + """ + Backup existing data to S3 + """ + bucket, obj_key = decode_s3_url(self.DF_OUTPUT) + old_leads = self._fetch_object_s3(bucket, obj_key) + if old_leads is None or "Body" not in old_leads: + return + + old_hash = hashlib.md5(old_leads["Body"].read()).hexdigest() + backup_key = "backup/" + datetime.now().strftime( + "%Y/%m/%d/%H%M%S_" + old_hash + ".csv" + ) + source = {"Bucket": bucket, "Key": obj_key} + try: + s3.copy(source, bucket, backup_key) + except botocore.exceptions.ClientError as e: + log.warning( + f"{e.response['Error']['Code']}: {e.response['Error']['Message']}" + if "Error" in e.response + else f"Error while backing up object s3://{bucket}/{obj_key}. Object does not exist" + ) + + log.info(f"Successful backup to s3://{bucket}/{backup_key}") + +
+[docs] + def insert_data(self, data): + """ + TODO: Insert new data into specified dataframe + :param data: Data to be inserted (desired format must be checked) + """ + pass
+ + +
+[docs] + def save_review(self, review, place_id, force_refresh=False): + """ + Upload review to specified review path + :param review: json contents of the review to be uploaded + """ + # Write the data to a JSON file + file_name = place_id + "_reviews.json" + bucket, key = decode_s3_url(self.REVIEWS) + key += file_name + + try: + # HeadObject throws an exception if the file doesn't exist + s3.head_object(Bucket=bucket, Key=key) + log.info(f"The file with key '{key}' exists in the bucket '{bucket}'.") + + except Exception as e: + log.info( + f"The file with key '{key}' does not exist in the bucket '{bucket}'." + ) + # Upload the JSON string to S3 + reviews_str = json.dumps(review) + s3.put_object(Body=reviews_str, Bucket=bucket, Key=key) + log.info("reviews uploaded to s3")
+ + +
+[docs] + def fetch_review(self, place_id): + """ + Fetch review for specified place_id + :return: json contents of desired review + """ + file_name = place_id + "_reviews.json" + bucket, key = decode_s3_url(self.REVIEWS) + key += file_name + + try: + response = s3.get_object(Bucket=bucket, Key=key) + file_content = response["Body"].read().decode("utf-8") + json_content = json.loads(file_content) + return json_content + except Exception as e: + log.info( + f"No reviews in S3 for place with at s3://{bucket}/{key}. Error: {str(e)}" + ) + return []
+ + +
+[docs] + def create_snapshot(self, df, prefix, name): + full_path = f"{self.SNAPSHOTS}{prefix}{name}_snapshot.csv" + bucket, key = decode_s3_url(full_path) + + csv_buffer = StringIO() + df.to_csv(csv_buffer, index=False) + self._save_to_s3(csv_buffer.getvalue(), bucket, key)
+ + +
+[docs] + def clean_snapshots(self, prefix): + pass
+ + +
+[docs] + def save_lookup_table(self, lookup_table: dict, step_name: str) -> None: + full_path = f"{self.LOOKUP_TABLES}{step_name}.csv" + bucket, key = decode_s3_url(full_path) + + csv_buffer = StringIO() + csv_writer = csv.writer(csv_buffer) + # Write Header + csv_writer.writerow( + [ + "HashedData", + "First Name", + "Last Name", + "Company / Account", + "Phone", + "Email", + "Last Updated", + ] + ) + # Write data rows + for hashed_data, other_columns in lookup_table.items(): + csv_writer.writerow([hashed_data] + other_columns) + + self._save_to_s3(csv_buffer.getvalue(), bucket, key)
+ + +
+[docs] + def load_lookup_table(self, step_name: str) -> dict: + file_name = f"{step_name}.csv" + bucket, key = decode_s3_url(self.LOOKUP_TABLES) + key += file_name + + lookup_table_s3_obj = self._fetch_object_s3(bucket, key) + lookup_table = {} + if lookup_table_s3_obj is None or "Body" not in lookup_table_s3_obj: + log.info(f"Couldn't find lookup table in S3 bucket {bucket} and key {key}.") + return lookup_table + + source = lookup_table_s3_obj["Body"] + # Read the CSV content from S3 into a string + csv_content = source.read().decode("utf-8") + # Use StringIO to create a file-like object + csv_buffer = StringIO(csv_content) + # Use csv.reader to read the CSV content + csv_reader = csv.reader(csv_buffer) + header = next(csv_reader) + for row in csv_reader: + hashed_data = row[0] + other_columns = row[1:] + lookup_table[hashed_data] = other_columns + return lookup_table
+ + +
+[docs] + def fetch_gpt_result(self, file_id, operation_name): + """ + Fetches the GPT result for a given file ID and operation name from S3 + """ + # Define the file name and path + file_name = f"{file_id}_gpt_result.json" + full_url_path = f"{self.GPT_RESULTS}{file_name}" + bucket, key = decode_s3_url(full_url_path) + + if not self._is_object_exists_on_S3(bucket, key): + return None + # Read data from s3 + existing_data = json.loads(self._load_from_s3(bucket, key)) + + # check if the element with the operation name exists + if operation_name in existing_data: + return existing_data[operation_name] + else: + return None
+ + +
+[docs] + def save_gpt_result(self, gpt_result, file_id, operation_name, force_refresh=False): + """ + Saves the GPT result for a given file ID and operation name on S3 + """ + # Define the file name and path + file_name = f"{file_id}_gpt_result.json" + full_url_path = f"{self.GPT_RESULTS}{file_name}" + bucket, key = decode_s3_url(full_url_path) + + # Get current date and time + current_time = self._get_current_time_as_string() + + # Prepare the data to be saved + data_to_save = {"result": gpt_result, "last_update_date": current_time} + + # Check if the file already exists + if self._is_object_exists_on_S3(bucket, key) and not force_refresh: + # Load the existing data + existing_data = json.loads(self._load_from_s3(bucket, key)) + + # Update the existing data with the new result + existing_data[operation_name] = data_to_save + + # Save the updated data back to S3 + self._save_to_s3(json.dumps(existing_data), bucket, key) + else: + # Save the new result to S3 + self._save_to_s3(json.dumps({operation_name: data_to_save}), bucket, key)
+ + +
+[docs] + def load_ml_model(self, model_name: str): + file_name = f"{model_name}" + bucket, key = decode_s3_url(self.ML_MODELS) + key += file_name + try: + with tempfile.TemporaryFile() as fp: + s3.download_fileobj(Fileobj=fp, Bucket=bucket, Key=key) + fp.seek(0) + model = joblib.load(fp) + return model + except Exception as e: + log.error(f"Error loading model '{model_name}': {str(e)}") + return None
+ + +
+[docs] + def save_ml_model(self, model, model_name: str): + full_path = f"{self.ML_MODELS}{model_name}" + bucket, key = decode_s3_url(full_path) + try: + with tempfile.TemporaryFile() as fp: + joblib.dump(model, fp) + fp.seek(0) + s3.upload_fileobj(fp, bucket, key) + except Exception as e: + log.error(f"Could not save model for '{model_name}' to S3: {str(e)}")
+ + +
+[docs] + def load_classification_report(self, model_name: str): + file_path = f"{self.CLASSIFICATION_REPORTS}report_{model_name}" + bucket, key = decode_s3_url(file_path) + + try: + with tempfile.TemporaryFile() as fp: + s3.download_fileobj(Fileobj=fp, Bucket=bucket, Key=key) + fp.seek(0) + report = joblib.load(fp) + return report + except Exception as e: + log.error(f"Error loading model '{model_name}': {str(e)}") + return None
+ + +
+[docs] + def save_classification_report(self, report, model_name: str): + file_path = f"{self.CLASSIFICATION_REPORTS}report_{model_name}" + bucket, key = decode_s3_url(file_path) + + try: + with tempfile.TemporaryFile() as fp: + joblib.dump(report, fp) + fp.seek(0) + s3.upload_fileobj(fp, bucket, key) + except Exception as e: + log.error(f"Could not save report for '{model_name}' to S3: {str(e)}")
+ + +
+[docs] + def get_preprocessed_data_path(self, historical: bool = True): + file_name = ( + "historical_preprocessed_data.csv" + if historical + else "preprocessed_data.csv" + ) + file_path = self.DF_PREPROCESSED_INPUT + file_name + return file_path
+ + +
+[docs] + def load_preprocessed_data(self, historical: bool = True): + file_path = self.get_preprocessed_data_path(historical) + + source = None + remote_dataset = None + + try: + bucket, obj_key = decode_s3_url(file_path) + remote_dataset = self._fetch_object_s3(bucket, obj_key) + except IndexError: + log.error( + "S3 location has to be defined like this: s3://<BUCKET>/<OBJECT_KEY>" + ) + + if remote_dataset is None or "Body" not in remote_dataset: + log.error(f"Couldn't find dataset in S3 bucket {bucket} and key {obj_key}") + return + else: + source = remote_dataset["Body"] + + try: + return pd.read_csv(source) + except FileNotFoundError: + log.error("Error: Could not find input file for Pipeline.")
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/demo/console_utils.html b/_modules/demo/console_utils.html new file mode 100644 index 0000000..ca909cb --- /dev/null +++ b/_modules/demo/console_utils.html @@ -0,0 +1,214 @@ + + + + + + demo.console_utils — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for demo.console_utils

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Berkay Bozkurt <resitberkaybozkurt@gmail.com>
+
+
+# Utility Functions
+
+[docs] +def get_yes_no_input(prompt: str) -> bool: + """ + Prompts the user with a given prompt and returns True if the user enters 'yes' or 'y', + and False if the user enters 'no' or 'n'. The input is case-insensitive. + + Args: + prompt (str): The prompt to display to the user. + + Returns: + bool: True if the user enters 'yes' or 'y', False if the user enters 'no' or 'n'. + """ + while True: + user_input = input(prompt).strip().lower() + if user_input in ["y", "yes"]: + return True + elif user_input in ["n", "no"]: + return False + else: + print("Invalid input. Please enter (yes/no) or (y/N).")
+ + + +
+[docs] +def get_string_input(prompt: str) -> str: + """ + Prompts the user with a given prompt and returns a non-empty string. + The input is case-sensitive and will be stripped from spaces. + + Args: + prompt (str): The prompt to display to the user. + + Returns: + str: Entered non-empty, stripped string + """ + while True: + user_input = input(prompt).strip() + if user_input != "": + return user_input
+ + + +
+[docs] +def get_int_input(prompt: str, input_range: range = None) -> int: + """ + Prompts the user for an integer input and validates it. + + Args: + prompt (str): The prompt message to display to the user. + input_range (range, optional): The range of valid input values. Defaults to None. + + Returns: + int: The validated integer input. + + Raises: + ValueError: If the input is not a valid integer. + + """ + while True: + try: + input_int = int(input(prompt)) + if input_range is not None and input_int not in input_range: + print("Invalid input. Please enter a valid integer.") + continue + else: + return input_int + except ValueError: + print("Invalid input. Please enter a valid integer.")
+ + + +
+[docs] +def get_multiple_choice(prompt: str, choices: list) -> str: + """ + Prompts the user with a message and a list of choices, and returns the selected choice. + + Args: + prompt (str): The message to display to the user. + choices (list): The list of choices to display to the user. + + Returns: + str: The selected choice. + + Raises: + ValueError: If the user enters an invalid input. + """ + while True: + try: + prompt += "".join( + f"({index}) : {choice} \n" for index, choice in enumerate(choices) + ) + ind = get_int_input(prompt, range(len(choices))) + return choices[ind] + except ValueError: + print("Invalid input. Please enter a valid integer.")
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/demo/demos.html b/_modules/demo/demos.html new file mode 100644 index 0000000..37122e1 --- /dev/null +++ b/_modules/demo/demos.html @@ -0,0 +1,486 @@ + + + + + + demo.demos — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for demo.demos

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Lucca Baumgärtner <lucca.baumgaertner@fau.de>
+# SPDX-FileCopyrightText: 2023 Sophie Heasman <sophieheasmann@gmail.com>
+# SPDX-FileCopyrightText: 2023 Felix Zailskas <felixzailskas@gmail.com>
+# SPDX-FileCopyrightText: 2023 Fabian-Paul Utech  <f.utech@gmx.net>
+# SPDX-FileCopyrightText: 2023 Ruchita Nathani <Ruchita.nathani@fau.de>
+# SPDX-FileCopyrightText: 2023 Ahmed Sheta <ahmed.sheta@fau.de>
+
+
+import re
+import warnings
+
+import pandas as pd
+import xgboost as xgb
+from sklearn.metrics import classification_report
+
+from bdc.pipeline import Pipeline
+from config import DATABASE_TYPE
+from database import get_database
+from demo.console_utils import (
+    get_int_input,
+    get_multiple_choice,
+    get_string_input,
+    get_yes_no_input,
+)
+from demo.pipeline_utils import (
+    get_all_available_pipeline_json_configs,
+    get_pipeline_additional_steps,
+    get_pipeline_config_from_json,
+    get_pipeline_initial_steps,
+)
+from evp import EstimatedValuePredictor
+from evp.predictors import MerchantSizeByDPV, Predictors
+from logger import get_logger
+from preprocessing import Preprocessing
+
+warnings.simplefilter(action="ignore", category=pd.errors.PerformanceWarning)
+warnings.simplefilter(action="ignore", category=FutureWarning)
+
+
+log = get_logger()
+
+# Constants and configurations
+LEADS_TRAIN_FILE = "data/leads_train.csv"
+LEADS_TEST_FILE = "data/leads_test.csv"
+INPUT_FILE_BDC = "../data/sumup_leads_email.csv"
+OUTPUT_FILE_BDC = "../data/collected_data.json"
+
+
+# evp demo
+
+[docs] +def evp_demo(): + data = get_database().load_preprocessed_data() + + model_type_choices = [e for e in Predictors] + print("Which model type do you want to load") + for i, p in enumerate(Predictors): + print(f"({i}) : {p.value}") + + choice = get_int_input("", range(0, len(model_type_choices))) + model_type = model_type_choices[choice] + + model_name = None + if get_yes_no_input("Load model from file? (y/N)\n"): + model_name = get_string_input("Provide model file name\n") + + limit_classes = False + if get_yes_no_input( + "Use 3 classes ({XS}, {S, M, L}, {XL}) instead of 5 classes ({XS}, {S}, {M}, {L}, {XL})? (y/N)\n" + ): + limit_classes = True + + feature_subsets = [ + ["Include all features"], + [ + "google_places_rating", + "google_places_user_ratings_total", + "google_places_confidence", + "regional_atlas_regional_score", + ], + ] + print("Do you want to train on a subset of features?") + + for i, p in enumerate(feature_subsets): + print(f"({i}) : {p}") + feature_choice = get_int_input("", range(0, len(feature_subsets))) + feature_choice = None if feature_choice == 0 else feature_subsets[feature_choice] + + evp = EstimatedValuePredictor( + data=data, + model_type=model_type, + model_name=model_name, + limit_classes=limit_classes, + selected_features=feature_choice, + ) + + while True: + choice = get_int_input( + "(1) Train\n(2) Test\n(3) Predict on single lead\n(4) Save model\n(5) Exit\n", + range(1, 6), + ) + if choice == 1: + evp.train() + elif choice == 2: + test_evp_model(evp) + elif choice == 3: + predict_single_lead(evp) + elif choice == 4: + evp.save_model() + elif choice == 5: + break + else: + print("Invalid choice")
+ + + +
+[docs] +def test_evp_model(evp: EstimatedValuePredictor): + predictions = evp.predict(evp.X_test) + if len(predictions) == 1 and predictions[0] == MerchantSizeByDPV.Invalid: + log.info("Untrained model results in no displayable data") + return + true_labels = evp.y_test + + print(classification_report(true_labels, predictions))
+ + + +
+[docs] +def predict_single_lead(evp: EstimatedValuePredictor): + leads = evp.X_test + lead_id = get_int_input( + f"Choose a lead_id in range [0, {len(leads) - 1}]\n", range(len(leads)) + ) + if 0 <= lead_id < len(leads): + prediction = evp.predict([leads[lead_id]]) + if prediction[0] == MerchantSizeByDPV.Invalid: + log.info("Untrained model results in no displayable data") + return + print( + f"Lead has predicted value of {prediction} and true value of {evp.y_test[lead_id]}" + ) + else: + print("Invalid Choice")
+ + + +
+[docs] +def add_step_if_requested(steps, step_class, step_desc, step_warning_message: str = ""): + if get_yes_no_input(f"Run {step_desc} {step_warning_message}(y/N)?\n"): + force = get_yes_no_input("Force execution if data is present? (y/N)\n") + steps.append(step_class(force_refresh=force))
+ + + +# pipeline_demo +
+[docs] +def pipeline_demo(): + """ + Demonstrates the execution of a pipeline. + + The function prompts the user to select a pipeline configuration or create a custom one. + It then sets a limit for the number of data points to be processed, if specified. + Finally, it runs the pipeline with the selected configuration and limit. + + Args: + None + + Returns: + None + """ + continue_with_custom_config = True + if get_yes_no_input(f"Do you want to list all available pipeline configs? (y/N)\n"): + # Create the formatted string using list comprehension and join + all_pipeline_configs = get_all_available_pipeline_json_configs() + if len(all_pipeline_configs) > 0: + prompt = "Please enter the index of requested pipeline config:\n" + choices = all_pipeline_configs + ["Exit"] + choice = get_multiple_choice(prompt, choices) + if choice != "Exit": + steps = get_pipeline_config_from_json(config_name=choice) + continue_with_custom_config = False + else: + print("Exiting...\n") + else: + print("No pipeline configs found.\n") + + if continue_with_custom_config: + print("Continuing with custom pipeline config...\n\n") + steps = [] + # get default steps and optional steps attrs + initial_steps_attr = get_pipeline_initial_steps() + additional_steps_attr = get_pipeline_additional_steps() + + # create step instances from default steps attrs and add them to steps list + for step_class, desc, warning_message in initial_steps_attr: + steps.append(step_class(force_refresh=True)) + + # add optional steps to steps list if requested + for step_class, desc, warning_message in additional_steps_attr: + add_step_if_requested(steps, step_class, desc, warning_message) + + limit = get_int_input("Set limit for data points to be processed (0=No limit)\n") + limit = limit if limit > 0 else None + + if ( + limit is not None + and get_database().DF_OUTPUT == "s3://amos--data--events/leads/enriched.csv" + ): + if get_yes_no_input( + f"The output cannot be limited when uploading to {get_database().DF_OUTPUT}.\nThe limit will be removed, and the pipeline will be executed on the full database.\n\nWould you like to continue? (y/n)\n" + ): + limit = None + else: + return + + steps_info = "\n".join([str(step) for step in steps]) + log.info( + f"Running Pipeline with steps:\n{steps_info}\ninput_location={get_database().get_input_path()}\noutput_location={get_database().get_enriched_data_path()}" + ) + + pipeline = Pipeline( + steps=steps, + limit=limit, + ) + + pipeline.run()
+ + + +
+[docs] +def preprocessing_demo(): + if get_yes_no_input("Filter out the API-irrelevant data? (y/n)\n"): + filter_bool = True + else: + filter_bool = False + if get_yes_no_input( + "Run on historical data ? (y/n)\n'n' means it will run on lead data!\n" + ): + historical_bool = True + else: + historical_bool = False + + preprocessor = Preprocessing( + filter_null_data=filter_bool, historical_bool=historical_bool + ) + + preprocessor.preprocessed_df = pd.read_csv(preprocessor.data_path) + + df = preprocessor.implement_preprocessing_pipeline() + preprocessor.save_preprocessed_data()
+ + + +
+[docs] +def predict_MerchantSize_on_lead_data_demo(): + import os + import sys + + import pandas as pd + + log.info( + "Note: In case of running locally, enriched data must be located at src/data/leads_enriched.csv\nIn case of running on S3, enriched data must be located at s3://amos--data--events/leads/enriched.csv" + ) + + ######################### preprocessing the leads ################################## + S3_bool = DATABASE_TYPE == "S3" + current_dir = os.path.dirname(__file__) if "__file__" in locals() else os.getcwd() + parent_dir = os.path.join(current_dir, "..") + sys.path.append(parent_dir) + from database import get_database + from preprocessing import Preprocessing + + db = get_database() + + log.info(f"Preprocessing the leads...") + preprocessor = Preprocessing(filter_null_data=False, historical_bool=False) + preprocessor.preprocessed_df = pd.read_csv(preprocessor.data_path) + df = preprocessor.implement_preprocessing_pipeline() + preprocessor.save_preprocessed_data() + + ############################## adapting the preprocessing files ########################### + log.info(f"Adapting the leads' preprocessed data for the ML model...") + # load the data from the CSV files + historical_preprocessed_data = db.load_preprocessed_data(historical=True) + unlabeled_preprocessed_data = db.load_preprocessed_data(historical=False) + + historical_columns_order = historical_preprocessed_data.columns + + missing_columns = set(historical_columns_order) - set( + unlabeled_preprocessed_data.columns + ) + unlabeled_preprocessed_data[list(missing_columns)] = 0 + + for column in unlabeled_preprocessed_data.columns: + if column not in historical_columns_order: + unlabeled_preprocessed_data = unlabeled_preprocessed_data.drop( + column, axis=1 + ) + + # reorder columns + unlabeled_preprocessed_data = unlabeled_preprocessed_data[historical_columns_order] + unlabeled_preprocessed_data.to_csv( + preprocessor.preprocessed_data_output_path, + index=False, + ) + log.info( + f"Saving the adapted preprocessed data at {preprocessor.preprocessed_data_output_path}" + ) + + # check if columns in both dataframe are in same order and same number + assert list(unlabeled_preprocessed_data.columns) == list( + historical_preprocessed_data.columns + ), "Column names are different" + + ####################### Applying ML model on lead data #################################### + + bucket_name = "amos--models" + + if S3_bool: + model_name = get_string_input( + "Provide model file name in amos--models/models S3 Bucket\nInput example: lightgbm_epochs(1)_f1(0.6375)_numclasses(5)_model.pkl\n" + ) + else: + model_name = get_string_input( + "Provide model file name in data/models local directory\nInput example: lightgbm_epochs(1)_f1(0.6375)_numclasses(5)_model.pkl\n" + ) + model_name = model_name.strip() + xgb_bool = False + if model_name.lower().startswith("xgb"): + xgb_bool = True + + def check_classification_task(string): + match = re.search(r"numclasses\((\d+)\)", string) + if match: + last_number = int(match.group(1)) + if last_number == 3: + return True + else: + False + + classification_task_3 = check_classification_task(model_name) + + try: + model = db.load_ml_model(model_name) + log.info(f"Loaded the model {model_name}!") + except: + log.error("No model found with the given name!") + return + + df = pd.read_csv(preprocessor.preprocessed_data_output_path) + input = df.drop("MerchantSizeByDPV", axis=1) + if xgb_bool: + input = xgb.DMatrix(input) + + predictions = model.predict(input) + if classification_task_3: + size_mapping = {0: "XS", 1: "{S, M, L}", 2: "XL"} + else: + size_mapping = {0: "XS", 1: "S", 2: "M", 3: "L", 4: "XL"} + remapped_predictions = [size_mapping[prediction] for prediction in predictions] + + enriched_data = pd.read_csv(preprocessor.data_path) + + # first 5 columns: Last Name,First Name,Company / Account,Phone,Email, + raw_data = enriched_data.iloc[:, :5] + raw_data["PredictedMerchantSize"] = remapped_predictions + + db.save_prediction(raw_data)
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/demo/pipeline_utils.html b/_modules/demo/pipeline_utils.html new file mode 100644 index 0000000..903ae4f --- /dev/null +++ b/_modules/demo/pipeline_utils.html @@ -0,0 +1,267 @@ + + + + + + demo.pipeline_utils — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for demo.pipeline_utils

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Berkay Bozkurt <resitberkaybozkurt@gmail.com>
+
+import json
+import os
+
+from logger import get_logger
+
+log = get_logger()
+
+from bdc.steps import (
+    AnalyzeEmails,
+    GooglePlaces,
+    GooglePlacesDetailed,
+    GPTReviewSentimentAnalyzer,
+    GPTSummarizer,
+    HashGenerator,
+    PreprocessPhonenumbers,
+    RegionalAtlas,
+    SearchOffeneRegister,
+    SmartReviewInsightsEnhancer,
+)
+
+DEFAULT_PIPELINE_PATH = os.path.join(os.path.dirname(__file__), "pipeline_configs/")
+
+STEP_STR_TO_CLASS = {
+    "HashGenerator": HashGenerator,
+    "AnalyzeEmails": AnalyzeEmails,
+    "GooglePlaces": GooglePlaces,
+    "GooglePlacesDetailed": GooglePlacesDetailed,
+    "GPTReviewSentimentAnalyzer": GPTReviewSentimentAnalyzer,
+    "GPTSummarizer": GPTSummarizer,
+    "PreprocessPhonenumbers": PreprocessPhonenumbers,
+    "RegionalAtlas": RegionalAtlas,
+    "SearchOffeneRegister": SearchOffeneRegister,
+    "SmartReviewInsightsEnhancer": SmartReviewInsightsEnhancer,
+}
+
+# Please do not write following lists! Use the functions below instead.
+_additional_pipeline_steps = [
+    (SearchOffeneRegister, "Search OffeneRegister", "(will take a long time)"),
+    (PreprocessPhonenumbers, "Phone Number Validation", ""),
+    (
+        GooglePlaces,
+        "Google API",
+        "(will use token and generate cost!)",
+    ),
+    (
+        GooglePlacesDetailed,
+        "Google API Detailed",
+        "(will use token and generate cost!)",
+    ),
+    (
+        GPTReviewSentimentAnalyzer,
+        "openAI GPT Sentiment Analyzer",
+        "(will use token and generate cost!)",
+    ),
+    (
+        GPTSummarizer,
+        "openAI GPT Summarizer",
+        "(will use token and generate cost!)",
+    ),
+    (
+        SmartReviewInsightsEnhancer,
+        "Smart Review Insights",
+        "(will take looong time!)",
+    ),
+    (RegionalAtlas, "Regionalatlas", ""),
+]
+
+_initial_pipeline_steps = [
+    (HashGenerator, "Hash Generator", ""),
+    (AnalyzeEmails, "Analyze Emails", ""),
+]
+# Please do not write above lists! Use the functions below instead.
+
+
+
+[docs] +def get_pipeline_steps() -> list: + """ + Returns a copy of the pipeline steps, which includes both the initial pipeline steps + and the additional pipeline steps. + + Returns: + list: A copy of the pipeline steps. + """ + return (_initial_pipeline_steps + _additional_pipeline_steps).copy()
+ + + +
+[docs] +def get_pipeline_initial_steps() -> list: + """ + Returns a copy of the initial pipeline steps. + + Returns: + list: A copy of the initial pipeline steps. + """ + return _initial_pipeline_steps.copy()
+ + + +
+[docs] +def get_pipeline_additional_steps() -> list: + """ + Returns a copy of the additional pipeline steps. + + Returns: + list: A copy of the additional pipeline steps. + """ + return _additional_pipeline_steps.copy()
+ + + +
+[docs] +def get_all_available_pipeline_json_configs( + config_path: str = DEFAULT_PIPELINE_PATH, +) -> list: + """ + Returns a list of all available pipeline json configs in the given path. + :param config_path: Path to the pipeline json configs + :return: List of all available pipeline json configs + """ + return [f for f in os.listdir(config_path) if f.endswith(".json")]
+ + + +
+[docs] +def get_pipeline_config_from_json( + config_name: str, config_path: str = DEFAULT_PIPELINE_PATH +) -> list: + """ + Retrieves the pipeline configuration from a JSON file. + + Args: + config_name (str): The name of the configuration file. + config_path (str, optional): The path to the configuration file. Defaults to DEFAULT_PIPELINE_PATH. + + Returns: + list: A list of pipeline steps. + + """ + with open(os.path.join(config_path, config_name), "r") as f: + steps_json = json.load(f) + steps = [] + for step in steps_json["config"]["steps"]: + log.info(f"Adding step {step}") + steps.append( + (STEP_STR_TO_CLASS[step["name"]](force_refresh=step["force_refresh"])) + ) + + return steps
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/evp/evp.html b/_modules/evp/evp.html new file mode 100644 index 0000000..a223c94 --- /dev/null +++ b/_modules/evp/evp.html @@ -0,0 +1,256 @@ + + + + + + evp.evp — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for evp.evp

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Felix Zailskas <felixzailskas@gmail.com>
+
+import lightgbm as lgb
+import numpy as np
+import pandas as pd
+import xgboost as xgb
+from sklearn.model_selection import train_test_split
+from sklearn.utils import class_weight
+
+from evp.predictors import (
+    XGB,
+    AdaBoost,
+    Classifier,
+    KNNClassifier,
+    LightGBM,
+    MerchantSizeByDPV,
+    NaiveBayesClassifier,
+    Predictors,
+    RandomForest,
+)
+from logger import get_logger
+
+log = get_logger()
+
+
+SEED = 42
+
+
+
+[docs] +class EstimatedValuePredictor: + lead_classifier: Classifier + + def __init__( + self, + data: pd.DataFrame, + train_size=0.8, + val_size=0.1, + test_size=0.1, + model_type: Predictors = Predictors.RandomForest, + model_name: str = None, + limit_classes: bool = False, + selected_features: list = None, + **model_args, + ) -> None: + self.df = data + self.num_classes = 5 + features = self.df.drop("MerchantSizeByDPV", axis=1) + if selected_features is not None: + features = features[selected_features] + features = features.to_numpy() + if limit_classes: + self.num_classes = 3 + self.df["new_labels"] = np.where( + self.df["MerchantSizeByDPV"] == 0, + 0, + np.where(self.df["MerchantSizeByDPV"] == 4, 2, 1), + ) + self.df = self.df.drop("MerchantSizeByDPV", axis=1) + self.df = self.df.rename(columns={"new_labels": "MerchantSizeByDPV"}) + self.class_labels = self.df["MerchantSizeByDPV"].to_numpy() + # split the data into training (80%), validation (10%), and testing (10%) sets + self.X_train, X_temp, self.y_train, y_temp = train_test_split( + features, self.class_labels, test_size=val_size + test_size, random_state=42 + ) + self.X_val, self.X_test, self.y_val, self.y_test = train_test_split( + X_temp, y_temp, test_size=val_size / (val_size + test_size), random_state=42 + ) + self.model_type = model_type + if model_type == Predictors.XGBoost: + self.dtrain_xgb = xgb.DMatrix(self.X_train, label=self.y_train) + self.dtest_xgb = xgb.DMatrix(self.X_test, label=self.y_test) + + # Class weights to tackle the class imbalance + class_weights = class_weight.compute_class_weight( + "balanced", classes=np.unique(self.y_train), y=self.y_train + ) + self.class_weight_dict = dict(zip(np.unique(self.y_train), class_weights)) + + match model_type: + case Predictors.RandomForest: + self.lead_classifier = RandomForest( + model_name=model_name, + class_weight=self.class_weight_dict, + **model_args, + ) + case Predictors.XGBoost: + self.lead_classifier = XGB( + model_name=model_name, + **model_args, + ) + case Predictors.NaiveBayes: + self.lead_classifier = NaiveBayesClassifier( + model_name=model_name, + **model_args, + ) + case Predictors.KNN: + self.lead_classifier = KNNClassifier( + model_name=model_name, **model_args + ) + case Predictors.AdaBoost: + self.lead_classifier = AdaBoost(model_name=model_name, **model_args) + case Predictors.LightGBM: + self.lead_classifier = LightGBM(model_name=model_name, **model_args) + case default: + log.error( + f"Error: EVP initialized with unsupported model type {model_type}!" + ) + +
+[docs] + def train(self, epochs=1, batch_size=None) -> None: + self.lead_classifier.train( + self.X_train, + self.y_train, + self.X_test, + self.y_test, + epochs=epochs, + batch_size=batch_size, + )
+ + +
+[docs] + def save_model(self) -> None: + self.lead_classifier.save(num_classes=self.num_classes)
+ + +
+[docs] + def predict(self, X) -> list[MerchantSizeByDPV]: + # use the models to predict required values + if ( + self.lead_classifier.classification_report["epochs"] == "untrained" + or self.lead_classifier.classification_report["weighted avg"]["f1-score"] + == "untrained" + ): + log.error("Cannot make predictions with untrained model!") + return [MerchantSizeByDPV.Invalid] + if self.model_type == Predictors.XGBoost: + merchant_size = self.lead_classifier.predict(self.dtest_xgb) + else: + merchant_size = self.lead_classifier.predict(X) + return merchant_size
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/evp/predictors.html b/_modules/evp/predictors.html new file mode 100644 index 0000000..e91507e --- /dev/null +++ b/_modules/evp/predictors.html @@ -0,0 +1,550 @@ + + + + + + evp.predictors — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for evp.predictors

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Felix Zailskas <felixzailskas@gmail.com>
+
+from abc import ABC, abstractmethod
+from enum import Enum
+
+import lightgbm as lgb
+import xgboost as xgb
+from sklearn.ensemble import AdaBoostClassifier, RandomForestClassifier
+from sklearn.metrics import accuracy_score, classification_report, f1_score
+from sklearn.naive_bayes import BernoulliNB
+from sklearn.neighbors import KNeighborsClassifier
+from sklearn.tree import DecisionTreeClassifier
+
+from database import get_database
+from logger import get_logger
+
+log = get_logger()
+
+
+
+[docs] +class Predictors(Enum): + RandomForest = "Random Forest" + XGBoost = "XGBoost" + NaiveBayes = "Naive Bayes" + KNN = "KNN Classifier" + AdaBoost = "AdaBoost" + LightGBM = "LightGBM"
+ + + +
+[docs] +class MerchantSizeByDPV(Enum): + Invalid = -1 + XS = 0 + S = 1 + M = 2 + L = 3 + XL = 4
+ + + +
+[docs] +class Classifier(ABC): + @abstractmethod + def __init__(self, model_name: str = None, *args, **kwargs) -> None: + self.epochs = "untrained" + self.f1_test = "untrained" + self.classification_report = { + "epochs": self.epochs, + "weighted avg": {"f1-score": self.f1_test}, + } + + @abstractmethod + def _init_new_model(self): + pass + +
+[docs] + @abstractmethod + def predict(self, X) -> list[MerchantSizeByDPV]: + pass
+ + +
+[docs] + @abstractmethod + def train( + self, X_train, y_train, X_test, y_test, epochs=1, batch_size=None + ) -> None: + log.info(f"Training {type(self).__name__} for {epochs} epochs") + + self.model.fit(X_train, y_train) + + y_pred = self.model.predict(X_test) + f1_test = f1_score(y_test, y_pred, average="weighted") + log.info(f"F1 Score on Testing Set: {f1_test:.4f}") + log.info("Computing classification report") + self.classification_report = classification_report( + y_test, y_pred, output_dict=True + ) + self.classification_report["epochs"] = epochs + self.epochs = epochs + self.f1_test = f1_test
+ + +
+[docs] + def save(self, num_classes: int = 5) -> None: + model_type = type(self).__name__ + try: + f1_string = f"{self.f1_test:.4f}" + except: + f1_string = self.f1_test + model_name = f"{model_type.lower()}_epochs({self.epochs})_f1({f1_string})_numclasses({num_classes})_model.pkl" + get_database().save_ml_model(self.model, model_name) + get_database().save_classification_report( + self.classification_report, model_name + )
+ + +
+[docs] + def load(self, model_name: str) -> None: + loaded_model = get_database().load_ml_model(model_name) + loaded_classification_report = get_database().load_classification_report( + model_name + ) + if loaded_model is not None: + self.model = loaded_model + if loaded_classification_report is not None: + self.classification_report = loaded_classification_report + self.epochs = self.classification_report["epochs"] + self.f1_test = self.classification_report["weighted avg"]["f1-score"]
+
+ + + +
+[docs] +class RandomForest(Classifier): + def __init__( + self, + model_name: str = None, + n_estimators=100, + class_weight=None, + random_state=42, + ) -> None: + super().__init__() + self.random_state = random_state + self.model = None + if model_name is not None: + self.load(model_name) + if self.model is None: + log.info( + f"Loading model '{model_name}' failed. Initializing new untrained model!" + ) + self._init_new_model( + n_estimators=n_estimators, class_weight=class_weight + ) + else: + self._init_new_model(n_estimators=n_estimators, class_weight=class_weight) + + def _init_new_model(self, n_estimators=100, class_weight=None): + self.model = RandomForestClassifier( + n_estimators=n_estimators, + class_weight=class_weight, + random_state=self.random_state, + ) + +
+[docs] + def predict(self, X) -> MerchantSizeByDPV: + return self.model.predict(X)
+ + +
+[docs] + def train( + self, X_train, y_train, X_test, y_test, epochs=1, batch_size=None + ) -> None: + super().train( + X_train, y_train, X_test, y_test, epochs=epochs, batch_size=batch_size + )
+
+ + + +
+[docs] +class NaiveBayesClassifier(Classifier): + def __init__(self, model_name: str = None, random_state=42) -> None: + super().__init__() + self.random_state = random_state + self.model = None + if model_name is not None: + self.load(model_name) + if self.model is None: + log.info( + f"Loading model '{model_name}' failed. Initializing new untrained model!" + ) + self._init_new_model() + else: + self._init_new_model() + + def _init_new_model(self): + self.model = BernoulliNB() + +
+[docs] + def predict(self, X) -> list[MerchantSizeByDPV]: + return self.model.predict(X)
+ + +
+[docs] + def train( + self, X_train, y_train, X_test, y_test, epochs=1, batch_size=None + ) -> None: + super().train( + X_train, y_train, X_test, y_test, epochs=epochs, batch_size=batch_size + )
+
+ + + +
+[docs] +class KNNClassifier(Classifier): + def __init__( + self, + model_name: str = None, + random_state=42, + n_neighbors=10, + weights="distance", + ) -> None: + super().__init__() + self.random_state = random_state + self.n_neighbors = n_neighbors + self.weights = weights + self.model = None + if model_name is not None: + self.load(model_name) + if self.model is None: + log.info( + f"Loading model '{model_name}' failed. Initializing new untrained model!" + ) + self._init_new_model() + else: + self._init_new_model() + + def _init_new_model(self): + self.model = KNeighborsClassifier( + n_neighbors=self.n_neighbors, weights=self.weights + ) + +
+[docs] + def predict(self, X) -> list[MerchantSizeByDPV]: + return self.model.predict(X)
+ + +
+[docs] + def train( + self, X_train, y_train, X_test, y_test, epochs=1, batch_size=None + ) -> None: + super().train( + X_train, y_train, X_test, y_test, epochs=epochs, batch_size=batch_size + )
+
+ + + +
+[docs] +class XGB(Classifier): + def __init__( + self, + model_name: str = None, + num_rounds=2000, + random_state=42, + ) -> None: + super().__init__() + self.random_state = random_state + self.model = None + self.num_rounds = num_rounds + if model_name is not None: + self.load(model_name) + if self.model is None: + log.info( + f"Loading model '{model_name}' failed. Initializing new untrained model!" + ) + self._init_new_model(num_rounds == num_rounds) + else: + self._init_new_model(num_rounds == num_rounds) + + def _init_new_model(self, num_rounds=1000): + self.params = { + "objective": "multi:softmax", + "num_class": 5, + "max_depth": 3, + "learning_rate": 0.1, + "eval_metric": "mlogloss", + } + +
+[docs] + def predict(self, X) -> MerchantSizeByDPV: + return self.model.predict(X)
+ + +
+[docs] + def train( + self, X_train, y_train, X_test, y_test, epochs=1, batch_size=None + ) -> None: + log.info("Training XGBoost") + + dtrain = xgb.DMatrix(X_train, label=y_train) + dtest = xgb.DMatrix(X_test, label=y_test) + self.model = xgb.train(self.params, dtrain, self.num_rounds) + + # inference + y_pred = self.model.predict(dtest) + # metrics + accuracy = accuracy_score(y_test, y_pred) + f1_test = f1_score(y_test, y_pred, average="weighted") + + log.info(f"F1 Score on Testing Set: {f1_test:.4f}") + log.info("Computing classification report") + self.classification_report = classification_report( + y_test, y_pred, output_dict=True + ) + self.classification_report["epochs"] = epochs + self.epochs = epochs + self.f1_test = f1_test
+
+ + + +
+[docs] +class AdaBoost(Classifier): + def __init__( + self, + model_name: str = None, + n_estimators=100, + class_weight=None, + random_state=42, + ) -> None: + super().__init__() + self.random_state = random_state + self.model = None + if model_name is not None: + self.load(model_name) + if self.model is None: + log.info( + f"Loading model '{model_name}' failed. Initializing new untrained model!" + ) + self._init_new_model( + n_estimators=n_estimators, class_weight=class_weight + ) + else: + self._init_new_model(n_estimators=n_estimators, class_weight=class_weight) + + def _init_new_model(self, n_estimators=100, class_weight=None): + self.model = AdaBoostClassifier( + estimator=DecisionTreeClassifier(max_depth=None, class_weight=class_weight), + n_estimators=n_estimators, + random_state=self.random_state, + ) + +
+[docs] + def predict(self, X) -> MerchantSizeByDPV: + return self.model.predict(X)
+ + +
+[docs] + def train( + self, X_train, y_train, X_test, y_test, epochs=1, batch_size=None + ) -> None: + super().train( + X_train, y_train, X_test, y_test, epochs=epochs, batch_size=batch_size + )
+
+ + + +
+[docs] +class LightGBM(Classifier): + def __init__( + self, + model_name: str = None, + num_leaves=1000, + random_state=42, + ) -> None: + super().__init__() + self.random_state = random_state + self.model = None + self.num_leaves = num_leaves + if model_name is not None: + self.load(model_name) + if self.model is None: + log.info( + f"Loading model '{model_name}' failed. Initializing new untrained model!" + ) + self._init_new_model(num_leaves == num_leaves) + else: + self._init_new_model(num_leaves == num_leaves) + + def _init_new_model(self, num_rounds=1000): + self.params_lgb = { + "boosting_type": "gbdt", + "objective": "multiclass", + "metric": "multi_logloss", + "num_class": 5, + "num_leaves": self.num_leaves, + "max_depth": -1, + "learning_rate": 0.05, + "feature_fraction": 0.9, + } + self.model = lgb.LGBMClassifier(**self.params_lgb) + +
+[docs] + def predict(self, X) -> MerchantSizeByDPV: + return self.model.predict(X)
+ + +
+[docs] + def train( + self, X_train, y_train, X_test, y_test, epochs=1, batch_size=None + ) -> None: + log.info("Training LightGBM") + + self.model.fit(X_train, y_train) + + # inference + y_pred = self.model.predict(X_test) + # metrics + accuracy = accuracy_score(y_test, y_pred) + f1_test = f1_score(y_test, y_pred, average="weighted") + + log.info(f"F1 Score on Testing Set: {f1_test:.4f}") + log.info("Computing classification report") + self.classification_report = classification_report( + y_test, y_pred, output_dict=True + ) + self.classification_report["epochs"] = epochs + self.epochs = epochs + self.f1_test = f1_test
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/index.html b/_modules/index.html new file mode 100644 index 0000000..c0369e4 --- /dev/null +++ b/_modules/index.html @@ -0,0 +1,135 @@ + + + + + + Overview: module code — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+
+ + + + \ No newline at end of file diff --git a/_modules/logger.html b/_modules/logger.html new file mode 100644 index 0000000..b24d1cd --- /dev/null +++ b/_modules/logger.html @@ -0,0 +1,130 @@ + + + + + + logger — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for logger

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Felix Zailskas <felixzailskas@gmail.com>
+
+import os
+
+from .logger import *
+
+_logger = None
+
+abspath = os.path.abspath(__file__)
+dname = os.path.dirname(abspath)
+
+
+
+[docs] +def get_logger() -> CustomLogger: + global _logger + if _logger is None: + _logger = CustomLogger("AMOS-APP", dname + "/../../logs/") + return _logger
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/logger/logger.html b/_modules/logger/logger.html new file mode 100644 index 0000000..c18349f --- /dev/null +++ b/_modules/logger/logger.html @@ -0,0 +1,265 @@ + + + + + + logger.logger — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for logger.logger

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Felix Zailskas <felixzailskas@gmail.com>
+
+# source: https://alexandra-zaharia.github.io/posts/custom-logger-in-python-for-stdout-and-or-file-log/
+
+import datetime
+import logging
+import os
+import sys
+
+
+
+[docs] +class StdOutFormatter(logging.Formatter): + grey = "\x1b[38;20m" + yellow = "\x1b[33;20m" + blue = "\033[34m" + red = "\x1b[31;20m" + bold_red = "\x1b[31;1m" + reset = "\x1b[0m" + fmt = "%(asctime)s | %(levelname)8s | %(filename)s:%(lineno)d | %(message)s" + + FORMATS = { + logging.DEBUG: grey + fmt + reset, + logging.INFO: blue + fmt + reset, + logging.WARNING: yellow + fmt + reset, + logging.ERROR: red + fmt + reset, + logging.CRITICAL: bold_red + fmt + reset, + } + + def __init__(self): + logging.Formatter.__init__(self, self.fmt) + +
+[docs] + def format(self, record): + log_fmt = self.FORMATS.get(record.levelno) + formatter = logging.Formatter(log_fmt) + return formatter.format(record)
+
+ + + +
+[docs] +class FileOutFormatter(logging.Formatter): + fmt = "%(asctime)s | %(levelname)8s | %(filename)s:%(lineno)d | %(message)s" + + def __init__(self): + logging.Formatter.__init__(self, self.fmt) + +
+[docs] + def format(self, record): + formatter = logging.Formatter(self.fmt) + return formatter.format(record)
+
+ + + +
+[docs] +class CustomLogger(logging.getLoggerClass()): + def __init__(self, name, log_dir=None): + # Create custom logger logging all five levels + super().__init__(name) + self.setLevel(logging.DEBUG) + + # Create stream handler for logging to stdout (log all five levels) + self.stdout_handler = logging.StreamHandler(sys.stdout) + self.stdout_handler.setLevel(logging.INFO) + self.stdout_handler.setFormatter(StdOutFormatter()) + self.enable_console_output() + + # Add file handler only if the log directory was specified + self.file_handler = None + if log_dir: + self.add_file_handler(name, log_dir) + +
+[docs] + def add_file_handler(self, name, log_dir): + """Add a file handler for this logger with the specified `name` (and + store the log file under `log_dir`).""" + + # Determine log path/file name; create log_dir if necessary + now = datetime.datetime.now().strftime("%Y%m%d_%H%M%S") + log_name = f'{str(name).replace(" ", "_")}_{now}' + if not os.path.exists(log_dir): + try: + os.makedirs(log_dir) + except: + print( + "{}: Cannot create directory {}. ".format( + self.__class__.__name__, log_dir + ), + end="", + file=sys.stderr, + ) + log_dir = "/tmp" if sys.platform.startswith("linux") else "." + print(f"Defaulting to {log_dir}.", file=sys.stderr) + + log_file = os.path.join(log_dir, log_name) + ".log" + + # Create file handler for logging to a file (log all five levels) + self.file_handler = logging.FileHandler(log_file) + self.file_handler.setLevel(logging.DEBUG) + self.file_handler.setFormatter(FileOutFormatter()) + self.addHandler(self.file_handler)
+ + +
+[docs] + def has_console_handler(self): + return len([h for h in self.handlers if type(h) == logging.StreamHandler]) > 0
+ + +
+[docs] + def has_file_handler(self): + return len([h for h in self.handlers if isinstance(h, logging.FileHandler)]) > 0
+ + +
+[docs] + def disable_console_output(self): + if not self.has_console_handler(): + return + self.removeHandler(self.stdout_handler)
+ + +
+[docs] + def enable_console_output(self): + if self.has_console_handler(): + return + self.addHandler(self.stdout_handler)
+ + +
+[docs] + def disable_file_output(self): + if not self.has_file_handler(): + return + self.removeHandler(self.file_handler)
+ + +
+[docs] + def enable_file_output(self): + if self.has_file_handler(): + return + self.addHandler(self.file_handler)
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_modules/preprocessing/preprocessing.html b/_modules/preprocessing/preprocessing.html new file mode 100644 index 0000000..6c609f7 --- /dev/null +++ b/_modules/preprocessing/preprocessing.html @@ -0,0 +1,403 @@ + + + + + + preprocessing.preprocessing — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +

Source code for preprocessing.preprocessing

+# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023 Ahmed Sheta <ahmed.sheta@fau.de>
+
+
+import os
+import sys
+from ast import literal_eval
+
+import pandas as pd
+from scipy import stats
+from sklearn.impute import SimpleImputer
+from sklearn.preprocessing import (
+    MinMaxScaler,
+    MultiLabelBinarizer,
+    Normalizer,
+    OneHotEncoder,
+    RobustScaler,
+    StandardScaler,
+)
+
+current_dir = os.path.dirname(__file__) if "__file__" in locals() else os.getcwd()
+parent_dir = os.path.join(current_dir, "..")
+sys.path.append(parent_dir)
+from database import get_database
+from logger import get_logger
+
+sys.path.append(current_dir)
+log = get_logger()
+
+
+
+[docs] +class Preprocessing: + def __init__(self, filter_null_data=True, historical_bool=True): + data_repo = get_database() + self.data_path = data_repo.get_enriched_data_path(historical=historical_bool) + self.preprocessed_df = None + self.preprocessed_data_output_path = data_repo.get_preprocessed_data_path( + historical_bool + ) + + self.filter_bool = filter_null_data + # columns that would be added later after one-hot encoding each class + self.added_features = [] + self.numerical_data = [ + "google_places_rating", + "google_places_user_ratings_total", + "google_places_confidence", + "reviews_sentiment_score", + "review_avg_grammatical_score", + "review_polarization_score", + "review_highest_rating_ratio", + "review_lowest_rating_ratio", + "review_rating_trend", + "regional_atlas_pop_density", + "regional_atlas_pop_development", + "regional_atlas_age_0", + "regional_atlas_age_1", + "regional_atlas_age_2", + "regional_atlas_age_3", + "regional_atlas_age_4", + "regional_atlas_pop_avg_age", + "regional_atlas_per_service_sector", + "regional_atlas_per_trade", + "regional_atlas_employment_rate", + "regional_atlas_unemployment_rate", + "regional_atlas_per_long_term_unemployment", + "regional_atlas_investments_p_employee", + "regional_atlas_gross_salary_p_employee", + "regional_atlas_disp_income_p_inhabitant", + "regional_atlas_tot_income_p_taxpayer", + "regional_atlas_gdp_p_employee", + "regional_atlas_gdp_development", + "regional_atlas_gdp_p_inhabitant", + "regional_atlas_gdp_p_workhours", + "regional_atlas_pop_avg_age_zensus", + "regional_atlas_regional_score", + ] + # numerical data that need scaling + self.data_to_scale = [] + + # categorical data that needs one-hot encoding + self.categorical_data = [ + # "number_country", + # "number_area", + "google_places_detailed_type", + "review_polarization_type", + ] + + self.class_labels = "MerchantSizeByDPV" + +
+[docs] + def filter_out_null_data(self): + self.preprocessed_df = self.preprocessed_df[ + self.preprocessed_df["google_places_rating"].notnull() + ]
+ + +
+[docs] + def fill_missing_values(self, column, strategy="constant"): + if ( + column in self.preprocessed_df.columns + and not self.preprocessed_df[column].empty + ): + imputer = SimpleImputer(strategy=strategy) + self.preprocessed_df[column] = imputer.fit_transform( + self.preprocessed_df[[column]] + ) + else: + log.info(f"The column '{column}' does not exist in the DataFrame.") + + return self.preprocessed_df
+ + +
+[docs] + def standard_scaling(self, column): + # scales the data in such that the mean of the data becomes 0 and the standard deviation becomes 1. + if column in self.preprocessed_df.columns: + scaler = StandardScaler() + self.preprocessed_df[column] = scaler.fit_transform( + self.preprocessed_df[[column]] + ) + return self.preprocessed_df
+ + +
+[docs] + def min_max_scaling(self, column): + # scales the data to a given range, usually between 0 and 1. + if column in self.preprocessed_df.columns: + scaler = MinMaxScaler() + self.preprocessed_df[column] = scaler.fit_transform( + self.preprocessed_df[[column]] + ) + return self.preprocessed_df
+ + +
+[docs] + def robust_scaling(self, column): + if column in self.preprocessed_df.columns: + scaler = RobustScaler() + self.preprocessed_df[column] = scaler.fit_transform( + self.preprocessed_df[[column]] + ) + return self.preprocessed_df
+ + +
+[docs] + def normalization(self, column): + if column in self.preprocessed_df.columns: + scaler = Normalizer() + self.preprocessed_df[column] = scaler.fit_transform( + self.preprocessed_df[[column]] + ) + return self.preprocessed_df
+ + +
+[docs] + def remove_outliers_zscore(self, column): + THRESHOLD = 3 + z_scores = stats.zscore(self.preprocessed_df[[column]]) + self.preprocessed_df[column] = self.preprocessed_df[ + (z_scores < THRESHOLD) & (z_scores > -1 * THRESHOLD) + ] + return self.preprocessed_df
+ + +
+[docs] + def class_label_encoding(self, column): + size_mapping = {"XS": 0, "S": 1, "M": 2, "L": 3, "XL": 4} + if column in self.preprocessed_df.columns: + self.preprocessed_df[column] = self.preprocessed_df[column].map( + size_mapping + ) + else: + log.info(f"Class labels {column} does not exist in the dataframe!") + return self.preprocessed_df
+ + +
+[docs] + def single_one_hot_encoding(self, column): + # one-hot encoding categorical data and creating columns for the newly created classes + if column in self.preprocessed_df.columns: + data_to_encode = self.preprocessed_df[[column]].fillna("").astype(str) + encoder = OneHotEncoder(sparse=False) + encoded_data = encoder.fit_transform(data_to_encode) + encoded_columns = encoder.get_feature_names_out([column]) + self.added_features.extend(encoded_columns) + encoded_df = pd.DataFrame( + encoded_data, columns=encoded_columns, index=self.preprocessed_df.index + ) + self.preprocessed_df = pd.concat([self.preprocessed_df, encoded_df], axis=1) + else: + log.info(f"The column '{column}' does not exist in the DataFrame.") + + return self.preprocessed_df
+ + +
+[docs] + def multiple_label_encoding(self, column): + if column in self.preprocessed_df.columns: + # one-hot encoding for the columns that has multiple labels as element + self.preprocessed_df[column].fillna("", inplace=True) + self.preprocessed_df[column] = self.preprocessed_df[column].apply( + lambda x: literal_eval(x) if x != "" else [] + ) + mlb = MultiLabelBinarizer() + encoded_data = mlb.fit_transform(self.preprocessed_df[column]) + self.added_features.extend(mlb.classes_) + if self.filter_bool: + encoded_df = pd.DataFrame( + encoded_data, columns=mlb.classes_, index=self.preprocessed_df.index + ) + else: + encoded_df = pd.DataFrame(encoded_data, columns=mlb.classes_) + self.preprocessed_df = pd.concat([self.preprocessed_df, encoded_df], axis=1) + else: + log.info(f"The column '{column}' does not exist in the DataFrame.") + + return self.preprocessed_df
+ + +
+[docs] + def implement_preprocessing_pipeline(self): + if self.filter_bool: + self.filter_out_null_data() + + for data_column in self.numerical_data: + self.preprocessed_df = self.fill_missing_values(data_column) + if data_column in self.data_to_scale: + self.preprocessed_df = self.robust_scaling(data_column) + + for data_column in self.categorical_data: + if data_column == "google_places_detailed_type": + continue + try: + self.preprocessed_df = self.single_one_hot_encoding(data_column) + except ValueError as e: + log.error( + f"Failed to one-hot encode data type ({data_column})! Error: {e}" + ) + + try: + self.preprocessed_df = self.multiple_label_encoding( + "google_places_detailed_type" + ) + except ValueError as e: + log.error( + f"Failed to one-hot encode data type 'google_places_detailed_type'! Error: {e}" + ) + + try: + self.preprocessed_df = self.class_label_encoding(self.class_labels) + except ValueError as e: + log.error(f"Failed to label the classes '{self.class_labels}'! Error: {e}") + + log.info("Preprocessing complete!") + + return self.preprocessed_df
+ + +
+[docs] + def save_preprocessed_data(self): + columns_to_save = [] + columns_to_save.extend(self.numerical_data) + columns_to_save.extend(self.added_features) + columns_to_save.append(self.class_labels) + selected_df = pd.DataFrame() + try: + for column in columns_to_save: + if column in self.preprocessed_df.columns: + selected_df[column] = self.preprocessed_df[column] + except ValueError as e: + log.error(f"Failed to save the selected columns for preprocessing! {e}") + try: + selected_df.to_csv(self.preprocessed_data_output_path, index=False) + log.info( + f"Preprocessed dataframe of shape {self.preprocessed_df.shape} is saved at {self.preprocessed_data_output_path}" + ) + except ValueError as e: + log.error(f"Failed to save preprocessed data file! {e}")
+
+ +
+ +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/_sources/bdc.rst.txt b/_sources/bdc.rst.txt new file mode 100644 index 0000000..087608b --- /dev/null +++ b/_sources/bdc.rst.txt @@ -0,0 +1,29 @@ +bdc package +=========== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + bdc.steps + +Submodules +---------- + +bdc.pipeline module +------------------- + +.. automodule:: bdc.pipeline + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: bdc + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/bdc.steps.helpers.rst.txt b/_sources/bdc.steps.helpers.rst.txt new file mode 100644 index 0000000..5f1dd8f --- /dev/null +++ b/_sources/bdc.steps.helpers.rst.txt @@ -0,0 +1,37 @@ +bdc.steps.helpers package +========================= + +Submodules +---------- + +bdc.steps.helpers.generate\_hash\_leads module +---------------------------------------------- + +.. automodule:: bdc.steps.helpers.generate_hash_leads + :members: + :undoc-members: + :show-inheritance: + +bdc.steps.helpers.offeneregister\_api module +-------------------------------------------- + +.. automodule:: bdc.steps.helpers.offeneregister_api + :members: + :undoc-members: + :show-inheritance: + +bdc.steps.helpers.text\_analyzer module +--------------------------------------- + +.. automodule:: bdc.steps.helpers.text_analyzer + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: bdc.steps.helpers + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/bdc.steps.rst.txt b/_sources/bdc.steps.rst.txt new file mode 100644 index 0000000..87114f7 --- /dev/null +++ b/_sources/bdc.steps.rst.txt @@ -0,0 +1,101 @@ +bdc.steps package +================= + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + bdc.steps.helpers + +Submodules +---------- + +bdc.steps.analyze\_emails module +-------------------------------- + +.. automodule:: bdc.steps.analyze_emails + :members: + :undoc-members: + :show-inheritance: + +bdc.steps.analyze\_reviews module +--------------------------------- + +.. automodule:: bdc.steps.analyze_reviews + :members: + :undoc-members: + :show-inheritance: + +bdc.steps.google\_places module +------------------------------- + +.. automodule:: bdc.steps.google_places + :members: + :undoc-members: + :show-inheritance: + +bdc.steps.google\_places\_detailed module +----------------------------------------- + +.. automodule:: bdc.steps.google_places_detailed + :members: + :undoc-members: + :show-inheritance: + +bdc.steps.gpt\_summarizer module +-------------------------------- + +.. automodule:: bdc.steps.gpt_summarizer + :members: + :undoc-members: + :show-inheritance: + +bdc.steps.hash\_generator module +-------------------------------- + +.. automodule:: bdc.steps.hash_generator + :members: + :undoc-members: + :show-inheritance: + +bdc.steps.preprocess\_phonenumbers module +----------------------------------------- + +.. automodule:: bdc.steps.preprocess_phonenumbers + :members: + :undoc-members: + :show-inheritance: + +bdc.steps.regionalatlas module +------------------------------ + +.. automodule:: bdc.steps.regionalatlas + :members: + :undoc-members: + :show-inheritance: + +bdc.steps.search\_offeneregister module +--------------------------------------- + +.. automodule:: bdc.steps.search_offeneregister + :members: + :undoc-members: + :show-inheritance: + +bdc.steps.step module +--------------------- + +.. automodule:: bdc.steps.step + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: bdc.steps + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/config.rst.txt b/_sources/config.rst.txt new file mode 100644 index 0000000..b559b61 --- /dev/null +++ b/_sources/config.rst.txt @@ -0,0 +1,7 @@ +config module +============= + +.. automodule:: config + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/database.leads.rst.txt b/_sources/database.leads.rst.txt new file mode 100644 index 0000000..6667bf8 --- /dev/null +++ b/_sources/database.leads.rst.txt @@ -0,0 +1,37 @@ +database.leads package +====================== + +Submodules +---------- + +database.leads.local\_repository module +--------------------------------------- + +.. automodule:: database.leads.local_repository + :members: + :undoc-members: + :show-inheritance: + +database.leads.repository module +-------------------------------- + +.. automodule:: database.leads.repository + :members: + :undoc-members: + :show-inheritance: + +database.leads.s3\_repository module +------------------------------------ + +.. automodule:: database.leads.s3_repository + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: database.leads + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/database.rst.txt b/_sources/database.rst.txt new file mode 100644 index 0000000..a5696fb --- /dev/null +++ b/_sources/database.rst.txt @@ -0,0 +1,18 @@ +database package +================ + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + database.leads + +Module contents +--------------- + +.. automodule:: database + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/demo.rst.txt b/_sources/demo.rst.txt new file mode 100644 index 0000000..6fa5c0e --- /dev/null +++ b/_sources/demo.rst.txt @@ -0,0 +1,37 @@ +demo package +============ + +Submodules +---------- + +demo.console\_utils module +-------------------------- + +.. automodule:: demo.console_utils + :members: + :undoc-members: + :show-inheritance: + +demo.demos module +----------------- + +.. automodule:: demo.demos + :members: + :undoc-members: + :show-inheritance: + +demo.pipeline\_utils module +--------------------------- + +.. automodule:: demo.pipeline_utils + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: demo + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/documentation.rst.txt b/_sources/documentation.rst.txt new file mode 100644 index 0000000..262a0e5 --- /dev/null +++ b/_sources/documentation.rst.txt @@ -0,0 +1,81 @@ +.. SPDX-License-Identifier: MIT +.. SPDX-FileCopyrightText: 2024 Simon Zimmermann + +Build Documentation +=================== +.. include:: ../../Documentation/Build-Documentation.md + :parser: myst_parser.sphinx_ + +User Documentation +================== +.. include:: ../../Documentation/User-Documentation.md + :parser: myst_parser.sphinx_ + +Design Documentation +==================== +.. include:: ../../Documentation/Design-Documentation.md + :parser: myst_parser.sphinx_ + +Data Fields +----------- +.. include:: ../../Documentation/Data-Fields.md + :parser: myst_parser.sphinx_ + +.. _\./data-fields\.csv: + +Data Fields CSV +--------------------- + +The following table highlights the data fields obtained for each lead. +The acquisition of such data may derive from the Lead Form or may be extracted from external sources utilizing APIs. + +.. csv-table:: Data Field Definition + :file: ../../Documentation/data-fields.csv + :header-rows: 1 + :widths: auto + +Google Search Strategy +---------------------- +.. include:: ../../Documentation/Google-Search-Strategy.md + :parser: myst_parser.sphinx_ + +OpenLLM Business Type Analysis +------------------------------ +.. include:: ../../Documentation/OpenLLm-Business-Type-Analysis.md + :parser: myst_parser.sphinx_ + +Classifier Comparison +===================== +.. include:: ../../Documentation/Classifier-Comparison.md + :parser: myst_parser.sphinx_ + +Concepts, Unrealized Ideas & Miscellaneous +========================================== + +.. include:: ../../Documentation/ideas.md + :parser: myst_parser.sphinx_ + +Controller +---------- +.. include:: ../../Documentation/Controller.md + :parser: myst_parser.sphinx_ + +Twitter API Limitation +---------------------- +.. include:: ../../Documentation/Twitter-API-Limitation.md + :parser: myst_parser.sphinx_ + +Contribution +------------ +.. include:: ../../Documentation/Contribution.md + :parser: myst_parser.sphinx_ + +SBOM Generator +-------------- +.. include:: ../../Documentation/SBOM_generator.md + :parser: myst_parser.sphinx_ + +Miscellaneous +------------- +.. include:: ../../Documentation/Miscellaneous.md + :parser: myst_parser.sphinx_ diff --git a/_sources/evp.rst.txt b/_sources/evp.rst.txt new file mode 100644 index 0000000..84c4aa8 --- /dev/null +++ b/_sources/evp.rst.txt @@ -0,0 +1,29 @@ +evp package +=========== + +Submodules +---------- + +evp.evp module +-------------- + +.. automodule:: evp.evp + :members: + :undoc-members: + :show-inheritance: + +evp.predictors module +--------------------- + +.. automodule:: evp.predictors + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: evp + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/index.rst.txt b/_sources/index.rst.txt new file mode 100644 index 0000000..d6ff4a0 --- /dev/null +++ b/_sources/index.rst.txt @@ -0,0 +1,25 @@ + .. SPDX-License-Identifier: MIT + SPDX-FileCopyrightText: 2023 Berkay Bozkurt + +.. Sales Lead Qualifier documentation master file, created by + sphinx-quickstart on Sat Feb 3 02:33:45 2024. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Sales Lead Qualifier's documentation! +================================================ + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + readme_link + documentation + modules + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/_sources/logger.rst.txt b/_sources/logger.rst.txt new file mode 100644 index 0000000..2262db5 --- /dev/null +++ b/_sources/logger.rst.txt @@ -0,0 +1,21 @@ +logger package +============== + +Submodules +---------- + +logger.logger module +-------------------- + +.. automodule:: logger.logger + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: logger + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/main.rst.txt b/_sources/main.rst.txt new file mode 100644 index 0000000..eace87b --- /dev/null +++ b/_sources/main.rst.txt @@ -0,0 +1,7 @@ +main module +=========== + +.. automodule:: main + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/modules.rst.txt b/_sources/modules.rst.txt new file mode 100644 index 0000000..3987dec --- /dev/null +++ b/_sources/modules.rst.txt @@ -0,0 +1,14 @@ +src +=== + +.. toctree:: + :maxdepth: 4 + + bdc + config + database + demo + evp + logger + main + preprocessing diff --git a/_sources/preprocessing.rst.txt b/_sources/preprocessing.rst.txt new file mode 100644 index 0000000..00869aa --- /dev/null +++ b/_sources/preprocessing.rst.txt @@ -0,0 +1,21 @@ +preprocessing package +===================== + +Submodules +---------- + +preprocessing.preprocessing module +---------------------------------- + +.. automodule:: preprocessing.preprocessing + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: preprocessing + :members: + :undoc-members: + :show-inheritance: diff --git a/_sources/readme_link.md.txt b/_sources/readme_link.md.txt new file mode 100644 index 0000000..e5f876e --- /dev/null +++ b/_sources/readme_link.md.txt @@ -0,0 +1,8 @@ + + +```{include} ../../README.md + +``` diff --git a/_static/BDC_Features.drawio b/_static/BDC_Features.drawio new file mode 100644 index 0000000..b109f91 --- /dev/null +++ b/_static/BDC_Features.drawio @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/_static/BDC_Features.drawio.license b/_static/BDC_Features.drawio.license new file mode 100644 index 0000000..dbe713d --- /dev/null +++ b/_static/BDC_Features.drawio.license @@ -0,0 +1,6 @@ +SPDX-License-Identifier: MIT +SPDX-FileCopyrightText: 2023 Lucca Baumgärtner +SPDX-FileCopyrightText: 2023 Sophie Heasman +SPDX-FileCopyrightText: 2023 Tetiana Kraft +SPDX-FileCopyrightText: 2023 Ruchita Nathani +SPDX-FileCopyrightText: 2023 Fabian-Paul Utech diff --git a/_static/_sphinx_javascript_frameworks_compat.js b/_static/_sphinx_javascript_frameworks_compat.js new file mode 100644 index 0000000..8141580 --- /dev/null +++ b/_static/_sphinx_javascript_frameworks_compat.js @@ -0,0 +1,123 @@ +/* Compatability shim for jQuery and underscores.js. + * + * Copyright Sphinx contributors + * Released under the two clause BSD licence + */ + +/** + * small helper function to urldecode strings + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL + */ +jQuery.urldecode = function(x) { + if (!x) { + return x + } + return decodeURIComponent(x.replace(/\+/g, ' ')); +}; + +/** + * small helper function to urlencode strings + */ +jQuery.urlencode = encodeURIComponent; + +/** + * This function returns the parsed url parameters of the + * current request. Multiple values per key are supported, + * it will always return arrays of strings for the value parts. + */ +jQuery.getQueryParameters = function(s) { + if (typeof s === 'undefined') + s = document.location.search; + var parts = s.substr(s.indexOf('?') + 1).split('&'); + var result = {}; + for (var i = 0; i < parts.length; i++) { + var tmp = parts[i].split('=', 2); + var key = jQuery.urldecode(tmp[0]); + var value = jQuery.urldecode(tmp[1]); + if (key in result) + result[key].push(value); + else + result[key] = [value]; + } + return result; +}; + +/** + * highlight a given string on a jquery object by wrapping it in + * span elements with the given class name. + */ +jQuery.fn.highlightText = function(text, className) { + function highlight(node, addItems) { + if (node.nodeType === 3) { + var val = node.nodeValue; + var pos = val.toLowerCase().indexOf(text); + if (pos >= 0 && + !jQuery(node.parentNode).hasClass(className) && + !jQuery(node.parentNode).hasClass("nohighlight")) { + var span; + var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.className = className; + } + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + node.parentNode.insertBefore(span, node.parentNode.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling)); + node.nodeValue = val.substr(0, pos); + if (isInSVG) { + var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); + var bbox = node.parentElement.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute('class', className); + addItems.push({ + "parent": node.parentNode, + "target": rect}); + } + } + } + else if (!jQuery(node).is("button, select, textarea")) { + jQuery.each(node.childNodes, function() { + highlight(this, addItems); + }); + } + } + var addItems = []; + var result = this.each(function() { + highlight(this, addItems); + }); + for (var i = 0; i < addItems.length; ++i) { + jQuery(addItems[i].parent).before(addItems[i].target); + } + return result; +}; + +/* + * backward compatibility for jQuery.browser + * This will be supported until firefox bug is fixed. + */ +if (!jQuery.browser) { + jQuery.uaMatch = function(ua) { + ua = ua.toLowerCase(); + + var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || + /(webkit)[ \/]([\w.]+)/.exec(ua) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || + /(msie) ([\w.]+)/.exec(ua) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || + []; + + return { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; + }; + jQuery.browser = {}; + jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; +} diff --git a/_static/basic.css b/_static/basic.css new file mode 100644 index 0000000..30fee9d --- /dev/null +++ b/_static/basic.css @@ -0,0 +1,925 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +div.section::after { + display: block; + content: ''; + clear: left; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li p.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 360px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +a:visited { + color: #551A8B; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, figure.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, figure.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, figure.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, figure.align-default, .figure.align-default { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-default { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar, +aside.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px; + background-color: #ffe; + width: 40%; + float: right; + clear: right; + overflow-x: auto; +} + +p.sidebar-title { + font-weight: bold; +} + +nav.contents, +aside.topic, +div.admonition, div.topic, blockquote { + clear: left; +} + +/* -- topics ---------------------------------------------------------------- */ + +nav.contents, +aside.topic, +div.topic { + border: 1px solid #ccc; + padding: 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +aside.sidebar > :last-child, +nav.contents > :last-child, +aside.topic > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +aside.sidebar::after, +nav.contents::after, +aside.topic::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + margin-top: 10px; + margin-bottom: 10px; + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table.align-default { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure, figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption, figcaption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number, +figcaption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text, +figcaption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist { + margin: 1em 0; +} + +table.hlist td { + vertical-align: top; +} + +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +aside.footnote > span, +div.citation > span { + float: left; +} +aside.footnote > span:last-of-type, +div.citation > span:last-of-type { + padding-right: 0.5em; +} +aside.footnote > p { + margin-left: 2em; +} +div.citation > p { + margin-left: 4em; +} +aside.footnote > p:last-of-type, +div.citation > p:last-of-type { + margin-bottom: 0em; +} +aside.footnote > p:last-of-type:after, +div.citation > p:last-of-type:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + +dl { + margin-bottom: 15px; +} + +dd > :first-child { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +.sig dd { + margin-top: 0px; + margin-bottom: 0px; +} + +.sig dl { + margin-top: 0px; + margin-bottom: 0px; +} + +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +.classifier:before { + font-style: normal; + margin: 0 0.5em; + content: ":"; + display: inline-block; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +.translated { + background-color: rgba(207, 255, 207, 0.2) +} + +.untranslated { + background-color: rgba(255, 207, 207, 0.2) +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +pre, div[class*="highlight-"] { + clear: both; +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; + white-space: nowrap; +} + +div[class*="highlight-"] { + margin: 1em 0; +} + +td.linenos pre { + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; +} + +table.highlighttable td { + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; +} + +div.code-block-caption { + margin-top: 1em; + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +table.highlighttable td.linenos, +span.linenos, +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + margin: 1em 0; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: absolute; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/_static/component-diagram-with-controller.svg b/_static/component-diagram-with-controller.svg new file mode 100644 index 0000000..778caeb --- /dev/null +++ b/_static/component-diagram-with-controller.svg @@ -0,0 +1,4 @@ + + + +
«component»
Base Data Collector
«component»Base Data Collector
«component»
Value Predictor
«component»...
SumUp
SumUp
«component»
Lead Form
«component»...
«component»
Customer Relationship
Management
«component»...
«component»
Controller
«component»Controller
Text is not SVG - cannot display
diff --git a/_static/component-diagram-with-controller.svg.license b/_static/component-diagram-with-controller.svg.license new file mode 100644 index 0000000..899fd72 --- /dev/null +++ b/_static/component-diagram-with-controller.svg.license @@ -0,0 +1,3 @@ +SPDX-License-Identifier: MIT +SPDX-FileCopyrightText: 2023 Simon Zimmermann +SPDX-FileCopyrightText: 2023 Lucca Baumgärtner diff --git a/_static/component-diagram.svg b/_static/component-diagram.svg new file mode 100644 index 0000000..4aab7d4 --- /dev/null +++ b/_static/component-diagram.svg @@ -0,0 +1,4 @@ + + + +
«component»
Base Data Collector
«component»
Merchant Size Predictor
SumUp
«component»
Lead Form
«component»
Customer Relationship
Management
AWS S3
diff --git a/_static/component-diagram.svg.license b/_static/component-diagram.svg.license new file mode 100644 index 0000000..2621f97 --- /dev/null +++ b/_static/component-diagram.svg.license @@ -0,0 +1,3 @@ +SPDX-License-Identifier: MIT +SPDX-FileCopyrightText: 2023 Lucca Baumgärtner +SPDX-FileCopyrightText: 2024 Simon Zimmermann diff --git a/_static/controller-workflow-diagram.jpg b/_static/controller-workflow-diagram.jpg new file mode 100644 index 0000000..b978bec Binary files /dev/null and b/_static/controller-workflow-diagram.jpg differ diff --git a/_static/controller-workflow-diagram.jpg.license b/_static/controller-workflow-diagram.jpg.license new file mode 100644 index 0000000..f079a3f --- /dev/null +++ b/_static/controller-workflow-diagram.jpg.license @@ -0,0 +1,2 @@ +SPDX-License-Identifier: MIT +SPDX-FileCopyrightText: 2023 Berkay Bozkurt diff --git a/_static/css/badge_only.css b/_static/css/badge_only.css new file mode 100644 index 0000000..c718cee --- /dev/null +++ b/_static/css/badge_only.css @@ -0,0 +1 @@ +.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}@font-face{font-family:FontAwesome;font-style:normal;font-weight:400;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#FontAwesome) format("svg")}.fa:before{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1}.fa:before,a .fa{text-decoration:inherit}.fa:before,a .fa,li .fa{display:inline-block}li .fa-large:before{width:1.875em}ul.fas{list-style-type:none;margin-left:2em;text-indent:-.8em}ul.fas li .fa{width:.8em}ul.fas li .fa-large:before{vertical-align:baseline}.fa-book:before,.icon-book:before{content:"\f02d"}.fa-caret-down:before,.icon-caret-down:before{content:"\f0d7"}.fa-caret-up:before,.icon-caret-up:before{content:"\f0d8"}.fa-caret-left:before,.icon-caret-left:before{content:"\f0d9"}.fa-caret-right:before,.icon-caret-right:before{content:"\f0da"}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60}.rst-versions .rst-current-version:after{clear:both;content:"";display:block}.rst-versions .rst-current-version .fa{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}} \ No newline at end of file diff --git a/_static/css/fonts/Roboto-Slab-Bold.woff b/_static/css/fonts/Roboto-Slab-Bold.woff new file mode 100644 index 0000000..6cb6000 Binary files /dev/null and b/_static/css/fonts/Roboto-Slab-Bold.woff differ diff --git a/_static/css/fonts/Roboto-Slab-Bold.woff2 b/_static/css/fonts/Roboto-Slab-Bold.woff2 new file mode 100644 index 0000000..7059e23 Binary files /dev/null and b/_static/css/fonts/Roboto-Slab-Bold.woff2 differ diff --git a/_static/css/fonts/Roboto-Slab-Regular.woff b/_static/css/fonts/Roboto-Slab-Regular.woff new file mode 100644 index 0000000..f815f63 Binary files /dev/null and b/_static/css/fonts/Roboto-Slab-Regular.woff differ diff --git a/_static/css/fonts/Roboto-Slab-Regular.woff2 b/_static/css/fonts/Roboto-Slab-Regular.woff2 new file mode 100644 index 0000000..f2c76e5 Binary files /dev/null and b/_static/css/fonts/Roboto-Slab-Regular.woff2 differ diff --git a/_static/css/fonts/fontawesome-webfont.eot b/_static/css/fonts/fontawesome-webfont.eot new file mode 100644 index 0000000..e9f60ca Binary files /dev/null and b/_static/css/fonts/fontawesome-webfont.eot differ diff --git a/_static/css/fonts/fontawesome-webfont.svg b/_static/css/fonts/fontawesome-webfont.svg new file mode 100644 index 0000000..855c845 --- /dev/null +++ b/_static/css/fonts/fontawesome-webfont.svg @@ -0,0 +1,2671 @@ + + + + +Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 + By ,,, +Copyright Dave Gandy 2016. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/_static/css/fonts/fontawesome-webfont.ttf b/_static/css/fonts/fontawesome-webfont.ttf new file mode 100644 index 0000000..35acda2 Binary files /dev/null and b/_static/css/fonts/fontawesome-webfont.ttf differ diff --git a/_static/css/fonts/fontawesome-webfont.woff b/_static/css/fonts/fontawesome-webfont.woff new file mode 100644 index 0000000..400014a Binary files /dev/null and b/_static/css/fonts/fontawesome-webfont.woff differ diff --git a/_static/css/fonts/fontawesome-webfont.woff2 b/_static/css/fonts/fontawesome-webfont.woff2 new file mode 100644 index 0000000..4d13fc6 Binary files /dev/null and b/_static/css/fonts/fontawesome-webfont.woff2 differ diff --git a/_static/css/fonts/lato-bold-italic.woff b/_static/css/fonts/lato-bold-italic.woff new file mode 100644 index 0000000..88ad05b Binary files /dev/null and b/_static/css/fonts/lato-bold-italic.woff differ diff --git a/_static/css/fonts/lato-bold-italic.woff2 b/_static/css/fonts/lato-bold-italic.woff2 new file mode 100644 index 0000000..c4e3d80 Binary files /dev/null and b/_static/css/fonts/lato-bold-italic.woff2 differ diff --git a/_static/css/fonts/lato-bold.woff b/_static/css/fonts/lato-bold.woff new file mode 100644 index 0000000..c6dff51 Binary files /dev/null and b/_static/css/fonts/lato-bold.woff differ diff --git a/_static/css/fonts/lato-bold.woff2 b/_static/css/fonts/lato-bold.woff2 new file mode 100644 index 0000000..bb19504 Binary files /dev/null and b/_static/css/fonts/lato-bold.woff2 differ diff --git a/_static/css/fonts/lato-normal-italic.woff b/_static/css/fonts/lato-normal-italic.woff new file mode 100644 index 0000000..76114bc Binary files /dev/null and b/_static/css/fonts/lato-normal-italic.woff differ diff --git a/_static/css/fonts/lato-normal-italic.woff2 b/_static/css/fonts/lato-normal-italic.woff2 new file mode 100644 index 0000000..3404f37 Binary files /dev/null and b/_static/css/fonts/lato-normal-italic.woff2 differ diff --git a/_static/css/fonts/lato-normal.woff b/_static/css/fonts/lato-normal.woff new file mode 100644 index 0000000..ae1307f Binary files /dev/null and b/_static/css/fonts/lato-normal.woff differ diff --git a/_static/css/fonts/lato-normal.woff2 b/_static/css/fonts/lato-normal.woff2 new file mode 100644 index 0000000..3bf9843 Binary files /dev/null and b/_static/css/fonts/lato-normal.woff2 differ diff --git a/_static/css/theme.css b/_static/css/theme.css new file mode 100644 index 0000000..19a446a --- /dev/null +++ b/_static/css/theme.css @@ -0,0 +1,4 @@ +html{box-sizing:border-box}*,:after,:before{box-sizing:inherit}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden],audio:not([controls]){display:none}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}blockquote{margin:0}dfn{font-style:italic}ins{background:#ff9;text-decoration:none}ins,mark{color:#000}mark{background:#ff0;font-style:italic;font-weight:700}.rst-content code,.rst-content tt,code,kbd,pre,samp{font-family:monospace,serif;_font-family:courier new,monospace;font-size:1em}pre{white-space:pre}q{quotes:none}q:after,q:before{content:"";content:none}small{font-size:85%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}dl,ol,ul{margin:0;padding:0;list-style:none;list-style-image:none}li{list-style:none}dd{margin:0}img{border:0;-ms-interpolation-mode:bicubic;vertical-align:middle;max-width:100%}svg:not(:root){overflow:hidden}figure,form{margin:0}label{cursor:pointer}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,input[type=button],input[type=reset],input[type=submit]{cursor:pointer;-webkit-appearance:button;*overflow:visible}button[disabled],input[disabled]{cursor:default}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}textarea{resize:vertical}table{border-collapse:collapse;border-spacing:0}td{vertical-align:top}.chromeframe{margin:.2em 0;background:#ccc;color:#000;padding:.2em 0}.ir{display:block;border:0;text-indent:-999em;overflow:hidden;background-color:transparent;background-repeat:no-repeat;text-align:left;direction:ltr;*line-height:0}.ir br{display:none}.hidden{display:none!important;visibility:hidden}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus{clip:auto;height:auto;margin:0;overflow:visible;position:static;width:auto}.invisible{visibility:hidden}.relative{position:relative}big,small{font-size:100%}@media print{body,html,section{background:none!important}*{box-shadow:none!important;text-shadow:none!important;filter:none!important;-ms-filter:none!important}a,a:visited{text-decoration:underline}.ir a:after,a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{page-break-inside:avoid}thead{display:table-header-group}img,tr{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}.rst-content .toctree-wrapper>p.caption,h2,h3,p{orphans:3;widows:3}.rst-content .toctree-wrapper>p.caption,h2,h3{page-break-after:avoid}}.btn,.fa:before,.icon:before,.rst-content .admonition,.rst-content .admonition-title:before,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .code-block-caption .headerlink:before,.rst-content .danger,.rst-content .eqno .headerlink:before,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-alert,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before,input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week],select,textarea{-webkit-font-smoothing:antialiased}.clearfix{*zoom:1}.clearfix:after,.clearfix:before{display:table;content:""}.clearfix:after{clear:both}/*! + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:FontAwesome;src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713);src:url(fonts/fontawesome-webfont.eot?674f50d287a8c48dc19ba404d20fe713?#iefix&v=4.7.0) format("embedded-opentype"),url(fonts/fontawesome-webfont.woff2?af7ae505a9eed503f8b8e6982036873e) format("woff2"),url(fonts/fontawesome-webfont.woff?fee66e712a8a08eef5805a46892932ad) format("woff"),url(fonts/fontawesome-webfont.ttf?b06871f281fee6b241d60582ae9369b9) format("truetype"),url(fonts/fontawesome-webfont.svg?912ec66d7572ff821749319396470bde#fontawesomeregular) format("svg");font-weight:400;font-style:normal}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14286em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14286em;width:2.14286em;top:.14286em;text-align:center}.fa-li.fa-lg{left:-1.85714em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa-pull-left.icon,.fa.fa-pull-left,.rst-content .code-block-caption .fa-pull-left.headerlink,.rst-content .eqno .fa-pull-left.headerlink,.rst-content .fa-pull-left.admonition-title,.rst-content code.download span.fa-pull-left:first-child,.rst-content dl dt .fa-pull-left.headerlink,.rst-content h1 .fa-pull-left.headerlink,.rst-content h2 .fa-pull-left.headerlink,.rst-content h3 .fa-pull-left.headerlink,.rst-content h4 .fa-pull-left.headerlink,.rst-content h5 .fa-pull-left.headerlink,.rst-content h6 .fa-pull-left.headerlink,.rst-content p .fa-pull-left.headerlink,.rst-content table>caption .fa-pull-left.headerlink,.rst-content tt.download span.fa-pull-left:first-child,.wy-menu-vertical li.current>a button.fa-pull-left.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-left.toctree-expand,.wy-menu-vertical li button.fa-pull-left.toctree-expand{margin-right:.3em}.fa-pull-right.icon,.fa.fa-pull-right,.rst-content .code-block-caption .fa-pull-right.headerlink,.rst-content .eqno .fa-pull-right.headerlink,.rst-content .fa-pull-right.admonition-title,.rst-content code.download span.fa-pull-right:first-child,.rst-content dl dt .fa-pull-right.headerlink,.rst-content h1 .fa-pull-right.headerlink,.rst-content h2 .fa-pull-right.headerlink,.rst-content h3 .fa-pull-right.headerlink,.rst-content h4 .fa-pull-right.headerlink,.rst-content h5 .fa-pull-right.headerlink,.rst-content h6 .fa-pull-right.headerlink,.rst-content p .fa-pull-right.headerlink,.rst-content table>caption .fa-pull-right.headerlink,.rst-content tt.download span.fa-pull-right:first-child,.wy-menu-vertical li.current>a button.fa-pull-right.toctree-expand,.wy-menu-vertical li.on a button.fa-pull-right.toctree-expand,.wy-menu-vertical li button.fa-pull-right.toctree-expand{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left,.pull-left.icon,.rst-content .code-block-caption .pull-left.headerlink,.rst-content .eqno .pull-left.headerlink,.rst-content .pull-left.admonition-title,.rst-content code.download span.pull-left:first-child,.rst-content dl dt .pull-left.headerlink,.rst-content h1 .pull-left.headerlink,.rst-content h2 .pull-left.headerlink,.rst-content h3 .pull-left.headerlink,.rst-content h4 .pull-left.headerlink,.rst-content h5 .pull-left.headerlink,.rst-content h6 .pull-left.headerlink,.rst-content p .pull-left.headerlink,.rst-content table>caption .pull-left.headerlink,.rst-content tt.download span.pull-left:first-child,.wy-menu-vertical li.current>a button.pull-left.toctree-expand,.wy-menu-vertical li.on a button.pull-left.toctree-expand,.wy-menu-vertical li button.pull-left.toctree-expand{margin-right:.3em}.fa.pull-right,.pull-right.icon,.rst-content .code-block-caption .pull-right.headerlink,.rst-content .eqno .pull-right.headerlink,.rst-content .pull-right.admonition-title,.rst-content code.download span.pull-right:first-child,.rst-content dl dt .pull-right.headerlink,.rst-content h1 .pull-right.headerlink,.rst-content h2 .pull-right.headerlink,.rst-content h3 .pull-right.headerlink,.rst-content h4 .pull-right.headerlink,.rst-content h5 .pull-right.headerlink,.rst-content h6 .pull-right.headerlink,.rst-content p .pull-right.headerlink,.rst-content table>caption .pull-right.headerlink,.rst-content tt.download span.pull-right:first-child,.wy-menu-vertical li.current>a button.pull-right.toctree-expand,.wy-menu-vertical li.on a button.pull-right.toctree-expand,.wy-menu-vertical li button.pull-right.toctree-expand{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s linear infinite;animation:fa-spin 2s linear infinite}.fa-pulse{-webkit-animation:fa-spin 1s steps(8) infinite;animation:fa-spin 1s steps(8) infinite}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scaleY(-1);-ms-transform:scaleY(-1);transform:scaleY(-1)}:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:""}.fa-music:before{content:""}.fa-search:before,.icon-search:before{content:""}.fa-envelope-o:before{content:""}.fa-heart:before{content:""}.fa-star:before{content:""}.fa-star-o:before{content:""}.fa-user:before{content:""}.fa-film:before{content:""}.fa-th-large:before{content:""}.fa-th:before{content:""}.fa-th-list:before{content:""}.fa-check:before{content:""}.fa-close:before,.fa-remove:before,.fa-times:before{content:""}.fa-search-plus:before{content:""}.fa-search-minus:before{content:""}.fa-power-off:before{content:""}.fa-signal:before{content:""}.fa-cog:before,.fa-gear:before{content:""}.fa-trash-o:before{content:""}.fa-home:before,.icon-home:before{content:""}.fa-file-o:before{content:""}.fa-clock-o:before{content:""}.fa-road:before{content:""}.fa-download:before,.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{content:""}.fa-arrow-circle-o-down:before{content:""}.fa-arrow-circle-o-up:before{content:""}.fa-inbox:before{content:""}.fa-play-circle-o:before{content:""}.fa-repeat:before,.fa-rotate-right:before{content:""}.fa-refresh:before{content:""}.fa-list-alt:before{content:""}.fa-lock:before{content:""}.fa-flag:before{content:""}.fa-headphones:before{content:""}.fa-volume-off:before{content:""}.fa-volume-down:before{content:""}.fa-volume-up:before{content:""}.fa-qrcode:before{content:""}.fa-barcode:before{content:""}.fa-tag:before{content:""}.fa-tags:before{content:""}.fa-book:before,.icon-book:before{content:""}.fa-bookmark:before{content:""}.fa-print:before{content:""}.fa-camera:before{content:""}.fa-font:before{content:""}.fa-bold:before{content:""}.fa-italic:before{content:""}.fa-text-height:before{content:""}.fa-text-width:before{content:""}.fa-align-left:before{content:""}.fa-align-center:before{content:""}.fa-align-right:before{content:""}.fa-align-justify:before{content:""}.fa-list:before{content:""}.fa-dedent:before,.fa-outdent:before{content:""}.fa-indent:before{content:""}.fa-video-camera:before{content:""}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:""}.fa-pencil:before{content:""}.fa-map-marker:before{content:""}.fa-adjust:before{content:""}.fa-tint:before{content:""}.fa-edit:before,.fa-pencil-square-o:before{content:""}.fa-share-square-o:before{content:""}.fa-check-square-o:before{content:""}.fa-arrows:before{content:""}.fa-step-backward:before{content:""}.fa-fast-backward:before{content:""}.fa-backward:before{content:""}.fa-play:before{content:""}.fa-pause:before{content:""}.fa-stop:before{content:""}.fa-forward:before{content:""}.fa-fast-forward:before{content:""}.fa-step-forward:before{content:""}.fa-eject:before{content:""}.fa-chevron-left:before{content:""}.fa-chevron-right:before{content:""}.fa-plus-circle:before{content:""}.fa-minus-circle:before{content:""}.fa-times-circle:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before{content:""}.fa-check-circle:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before{content:""}.fa-question-circle:before{content:""}.fa-info-circle:before{content:""}.fa-crosshairs:before{content:""}.fa-times-circle-o:before{content:""}.fa-check-circle-o:before{content:""}.fa-ban:before{content:""}.fa-arrow-left:before{content:""}.fa-arrow-right:before{content:""}.fa-arrow-up:before{content:""}.fa-arrow-down:before{content:""}.fa-mail-forward:before,.fa-share:before{content:""}.fa-expand:before{content:""}.fa-compress:before{content:""}.fa-plus:before{content:""}.fa-minus:before{content:""}.fa-asterisk:before{content:""}.fa-exclamation-circle:before,.rst-content .admonition-title:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before{content:""}.fa-gift:before{content:""}.fa-leaf:before{content:""}.fa-fire:before,.icon-fire:before{content:""}.fa-eye:before{content:""}.fa-eye-slash:before{content:""}.fa-exclamation-triangle:before,.fa-warning:before{content:""}.fa-plane:before{content:""}.fa-calendar:before{content:""}.fa-random:before{content:""}.fa-comment:before{content:""}.fa-magnet:before{content:""}.fa-chevron-up:before{content:""}.fa-chevron-down:before{content:""}.fa-retweet:before{content:""}.fa-shopping-cart:before{content:""}.fa-folder:before{content:""}.fa-folder-open:before{content:""}.fa-arrows-v:before{content:""}.fa-arrows-h:before{content:""}.fa-bar-chart-o:before,.fa-bar-chart:before{content:""}.fa-twitter-square:before{content:""}.fa-facebook-square:before{content:""}.fa-camera-retro:before{content:""}.fa-key:before{content:""}.fa-cogs:before,.fa-gears:before{content:""}.fa-comments:before{content:""}.fa-thumbs-o-up:before{content:""}.fa-thumbs-o-down:before{content:""}.fa-star-half:before{content:""}.fa-heart-o:before{content:""}.fa-sign-out:before{content:""}.fa-linkedin-square:before{content:""}.fa-thumb-tack:before{content:""}.fa-external-link:before{content:""}.fa-sign-in:before{content:""}.fa-trophy:before{content:""}.fa-github-square:before{content:""}.fa-upload:before{content:""}.fa-lemon-o:before{content:""}.fa-phone:before{content:""}.fa-square-o:before{content:""}.fa-bookmark-o:before{content:""}.fa-phone-square:before{content:""}.fa-twitter:before{content:""}.fa-facebook-f:before,.fa-facebook:before{content:""}.fa-github:before,.icon-github:before{content:""}.fa-unlock:before{content:""}.fa-credit-card:before{content:""}.fa-feed:before,.fa-rss:before{content:""}.fa-hdd-o:before{content:""}.fa-bullhorn:before{content:""}.fa-bell:before{content:""}.fa-certificate:before{content:""}.fa-hand-o-right:before{content:""}.fa-hand-o-left:before{content:""}.fa-hand-o-up:before{content:""}.fa-hand-o-down:before{content:""}.fa-arrow-circle-left:before,.icon-circle-arrow-left:before{content:""}.fa-arrow-circle-right:before,.icon-circle-arrow-right:before{content:""}.fa-arrow-circle-up:before{content:""}.fa-arrow-circle-down:before{content:""}.fa-globe:before{content:""}.fa-wrench:before{content:""}.fa-tasks:before{content:""}.fa-filter:before{content:""}.fa-briefcase:before{content:""}.fa-arrows-alt:before{content:""}.fa-group:before,.fa-users:before{content:""}.fa-chain:before,.fa-link:before,.icon-link:before{content:""}.fa-cloud:before{content:""}.fa-flask:before{content:""}.fa-cut:before,.fa-scissors:before{content:""}.fa-copy:before,.fa-files-o:before{content:""}.fa-paperclip:before{content:""}.fa-floppy-o:before,.fa-save:before{content:""}.fa-square:before{content:""}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:""}.fa-list-ul:before{content:""}.fa-list-ol:before{content:""}.fa-strikethrough:before{content:""}.fa-underline:before{content:""}.fa-table:before{content:""}.fa-magic:before{content:""}.fa-truck:before{content:""}.fa-pinterest:before{content:""}.fa-pinterest-square:before{content:""}.fa-google-plus-square:before{content:""}.fa-google-plus:before{content:""}.fa-money:before{content:""}.fa-caret-down:before,.icon-caret-down:before,.wy-dropdown .caret:before{content:""}.fa-caret-up:before{content:""}.fa-caret-left:before{content:""}.fa-caret-right:before{content:""}.fa-columns:before{content:""}.fa-sort:before,.fa-unsorted:before{content:""}.fa-sort-desc:before,.fa-sort-down:before{content:""}.fa-sort-asc:before,.fa-sort-up:before{content:""}.fa-envelope:before{content:""}.fa-linkedin:before{content:""}.fa-rotate-left:before,.fa-undo:before{content:""}.fa-gavel:before,.fa-legal:before{content:""}.fa-dashboard:before,.fa-tachometer:before{content:""}.fa-comment-o:before{content:""}.fa-comments-o:before{content:""}.fa-bolt:before,.fa-flash:before{content:""}.fa-sitemap:before{content:""}.fa-umbrella:before{content:""}.fa-clipboard:before,.fa-paste:before{content:""}.fa-lightbulb-o:before{content:""}.fa-exchange:before{content:""}.fa-cloud-download:before{content:""}.fa-cloud-upload:before{content:""}.fa-user-md:before{content:""}.fa-stethoscope:before{content:""}.fa-suitcase:before{content:""}.fa-bell-o:before{content:""}.fa-coffee:before{content:""}.fa-cutlery:before{content:""}.fa-file-text-o:before{content:""}.fa-building-o:before{content:""}.fa-hospital-o:before{content:""}.fa-ambulance:before{content:""}.fa-medkit:before{content:""}.fa-fighter-jet:before{content:""}.fa-beer:before{content:""}.fa-h-square:before{content:""}.fa-plus-square:before{content:""}.fa-angle-double-left:before{content:""}.fa-angle-double-right:before{content:""}.fa-angle-double-up:before{content:""}.fa-angle-double-down:before{content:""}.fa-angle-left:before{content:""}.fa-angle-right:before{content:""}.fa-angle-up:before{content:""}.fa-angle-down:before{content:""}.fa-desktop:before{content:""}.fa-laptop:before{content:""}.fa-tablet:before{content:""}.fa-mobile-phone:before,.fa-mobile:before{content:""}.fa-circle-o:before{content:""}.fa-quote-left:before{content:""}.fa-quote-right:before{content:""}.fa-spinner:before{content:""}.fa-circle:before{content:""}.fa-mail-reply:before,.fa-reply:before{content:""}.fa-github-alt:before{content:""}.fa-folder-o:before{content:""}.fa-folder-open-o:before{content:""}.fa-smile-o:before{content:""}.fa-frown-o:before{content:""}.fa-meh-o:before{content:""}.fa-gamepad:before{content:""}.fa-keyboard-o:before{content:""}.fa-flag-o:before{content:""}.fa-flag-checkered:before{content:""}.fa-terminal:before{content:""}.fa-code:before{content:""}.fa-mail-reply-all:before,.fa-reply-all:before{content:""}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:""}.fa-location-arrow:before{content:""}.fa-crop:before{content:""}.fa-code-fork:before{content:""}.fa-chain-broken:before,.fa-unlink:before{content:""}.fa-question:before{content:""}.fa-info:before{content:""}.fa-exclamation:before{content:""}.fa-superscript:before{content:""}.fa-subscript:before{content:""}.fa-eraser:before{content:""}.fa-puzzle-piece:before{content:""}.fa-microphone:before{content:""}.fa-microphone-slash:before{content:""}.fa-shield:before{content:""}.fa-calendar-o:before{content:""}.fa-fire-extinguisher:before{content:""}.fa-rocket:before{content:""}.fa-maxcdn:before{content:""}.fa-chevron-circle-left:before{content:""}.fa-chevron-circle-right:before{content:""}.fa-chevron-circle-up:before{content:""}.fa-chevron-circle-down:before{content:""}.fa-html5:before{content:""}.fa-css3:before{content:""}.fa-anchor:before{content:""}.fa-unlock-alt:before{content:""}.fa-bullseye:before{content:""}.fa-ellipsis-h:before{content:""}.fa-ellipsis-v:before{content:""}.fa-rss-square:before{content:""}.fa-play-circle:before{content:""}.fa-ticket:before{content:""}.fa-minus-square:before{content:""}.fa-minus-square-o:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before{content:""}.fa-level-up:before{content:""}.fa-level-down:before{content:""}.fa-check-square:before{content:""}.fa-pencil-square:before{content:""}.fa-external-link-square:before{content:""}.fa-share-square:before{content:""}.fa-compass:before{content:""}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:""}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:""}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:""}.fa-eur:before,.fa-euro:before{content:""}.fa-gbp:before{content:""}.fa-dollar:before,.fa-usd:before{content:""}.fa-inr:before,.fa-rupee:before{content:""}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:""}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:""}.fa-krw:before,.fa-won:before{content:""}.fa-bitcoin:before,.fa-btc:before{content:""}.fa-file:before{content:""}.fa-file-text:before{content:""}.fa-sort-alpha-asc:before{content:""}.fa-sort-alpha-desc:before{content:""}.fa-sort-amount-asc:before{content:""}.fa-sort-amount-desc:before{content:""}.fa-sort-numeric-asc:before{content:""}.fa-sort-numeric-desc:before{content:""}.fa-thumbs-up:before{content:""}.fa-thumbs-down:before{content:""}.fa-youtube-square:before{content:""}.fa-youtube:before{content:""}.fa-xing:before{content:""}.fa-xing-square:before{content:""}.fa-youtube-play:before{content:""}.fa-dropbox:before{content:""}.fa-stack-overflow:before{content:""}.fa-instagram:before{content:""}.fa-flickr:before{content:""}.fa-adn:before{content:""}.fa-bitbucket:before,.icon-bitbucket:before{content:""}.fa-bitbucket-square:before{content:""}.fa-tumblr:before{content:""}.fa-tumblr-square:before{content:""}.fa-long-arrow-down:before{content:""}.fa-long-arrow-up:before{content:""}.fa-long-arrow-left:before{content:""}.fa-long-arrow-right:before{content:""}.fa-apple:before{content:""}.fa-windows:before{content:""}.fa-android:before{content:""}.fa-linux:before{content:""}.fa-dribbble:before{content:""}.fa-skype:before{content:""}.fa-foursquare:before{content:""}.fa-trello:before{content:""}.fa-female:before{content:""}.fa-male:before{content:""}.fa-gittip:before,.fa-gratipay:before{content:""}.fa-sun-o:before{content:""}.fa-moon-o:before{content:""}.fa-archive:before{content:""}.fa-bug:before{content:""}.fa-vk:before{content:""}.fa-weibo:before{content:""}.fa-renren:before{content:""}.fa-pagelines:before{content:""}.fa-stack-exchange:before{content:""}.fa-arrow-circle-o-right:before{content:""}.fa-arrow-circle-o-left:before{content:""}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:""}.fa-dot-circle-o:before{content:""}.fa-wheelchair:before{content:""}.fa-vimeo-square:before{content:""}.fa-try:before,.fa-turkish-lira:before{content:""}.fa-plus-square-o:before,.wy-menu-vertical li button.toctree-expand:before{content:""}.fa-space-shuttle:before{content:""}.fa-slack:before{content:""}.fa-envelope-square:before{content:""}.fa-wordpress:before{content:""}.fa-openid:before{content:""}.fa-bank:before,.fa-institution:before,.fa-university:before{content:""}.fa-graduation-cap:before,.fa-mortar-board:before{content:""}.fa-yahoo:before{content:""}.fa-google:before{content:""}.fa-reddit:before{content:""}.fa-reddit-square:before{content:""}.fa-stumbleupon-circle:before{content:""}.fa-stumbleupon:before{content:""}.fa-delicious:before{content:""}.fa-digg:before{content:""}.fa-pied-piper-pp:before{content:""}.fa-pied-piper-alt:before{content:""}.fa-drupal:before{content:""}.fa-joomla:before{content:""}.fa-language:before{content:""}.fa-fax:before{content:""}.fa-building:before{content:""}.fa-child:before{content:""}.fa-paw:before{content:""}.fa-spoon:before{content:""}.fa-cube:before{content:""}.fa-cubes:before{content:""}.fa-behance:before{content:""}.fa-behance-square:before{content:""}.fa-steam:before{content:""}.fa-steam-square:before{content:""}.fa-recycle:before{content:""}.fa-automobile:before,.fa-car:before{content:""}.fa-cab:before,.fa-taxi:before{content:""}.fa-tree:before{content:""}.fa-spotify:before{content:""}.fa-deviantart:before{content:""}.fa-soundcloud:before{content:""}.fa-database:before{content:""}.fa-file-pdf-o:before{content:""}.fa-file-word-o:before{content:""}.fa-file-excel-o:before{content:""}.fa-file-powerpoint-o:before{content:""}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:""}.fa-file-archive-o:before,.fa-file-zip-o:before{content:""}.fa-file-audio-o:before,.fa-file-sound-o:before{content:""}.fa-file-movie-o:before,.fa-file-video-o:before{content:""}.fa-file-code-o:before{content:""}.fa-vine:before{content:""}.fa-codepen:before{content:""}.fa-jsfiddle:before{content:""}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:""}.fa-circle-o-notch:before{content:""}.fa-ra:before,.fa-rebel:before,.fa-resistance:before{content:""}.fa-empire:before,.fa-ge:before{content:""}.fa-git-square:before{content:""}.fa-git:before{content:""}.fa-hacker-news:before,.fa-y-combinator-square:before,.fa-yc-square:before{content:""}.fa-tencent-weibo:before{content:""}.fa-qq:before{content:""}.fa-wechat:before,.fa-weixin:before{content:""}.fa-paper-plane:before,.fa-send:before{content:""}.fa-paper-plane-o:before,.fa-send-o:before{content:""}.fa-history:before{content:""}.fa-circle-thin:before{content:""}.fa-header:before{content:""}.fa-paragraph:before{content:""}.fa-sliders:before{content:""}.fa-share-alt:before{content:""}.fa-share-alt-square:before{content:""}.fa-bomb:before{content:""}.fa-futbol-o:before,.fa-soccer-ball-o:before{content:""}.fa-tty:before{content:""}.fa-binoculars:before{content:""}.fa-plug:before{content:""}.fa-slideshare:before{content:""}.fa-twitch:before{content:""}.fa-yelp:before{content:""}.fa-newspaper-o:before{content:""}.fa-wifi:before{content:""}.fa-calculator:before{content:""}.fa-paypal:before{content:""}.fa-google-wallet:before{content:""}.fa-cc-visa:before{content:""}.fa-cc-mastercard:before{content:""}.fa-cc-discover:before{content:""}.fa-cc-amex:before{content:""}.fa-cc-paypal:before{content:""}.fa-cc-stripe:before{content:""}.fa-bell-slash:before{content:""}.fa-bell-slash-o:before{content:""}.fa-trash:before{content:""}.fa-copyright:before{content:""}.fa-at:before{content:""}.fa-eyedropper:before{content:""}.fa-paint-brush:before{content:""}.fa-birthday-cake:before{content:""}.fa-area-chart:before{content:""}.fa-pie-chart:before{content:""}.fa-line-chart:before{content:""}.fa-lastfm:before{content:""}.fa-lastfm-square:before{content:""}.fa-toggle-off:before{content:""}.fa-toggle-on:before{content:""}.fa-bicycle:before{content:""}.fa-bus:before{content:""}.fa-ioxhost:before{content:""}.fa-angellist:before{content:""}.fa-cc:before{content:""}.fa-ils:before,.fa-shekel:before,.fa-sheqel:before{content:""}.fa-meanpath:before{content:""}.fa-buysellads:before{content:""}.fa-connectdevelop:before{content:""}.fa-dashcube:before{content:""}.fa-forumbee:before{content:""}.fa-leanpub:before{content:""}.fa-sellsy:before{content:""}.fa-shirtsinbulk:before{content:""}.fa-simplybuilt:before{content:""}.fa-skyatlas:before{content:""}.fa-cart-plus:before{content:""}.fa-cart-arrow-down:before{content:""}.fa-diamond:before{content:""}.fa-ship:before{content:""}.fa-user-secret:before{content:""}.fa-motorcycle:before{content:""}.fa-street-view:before{content:""}.fa-heartbeat:before{content:""}.fa-venus:before{content:""}.fa-mars:before{content:""}.fa-mercury:before{content:""}.fa-intersex:before,.fa-transgender:before{content:""}.fa-transgender-alt:before{content:""}.fa-venus-double:before{content:""}.fa-mars-double:before{content:""}.fa-venus-mars:before{content:""}.fa-mars-stroke:before{content:""}.fa-mars-stroke-v:before{content:""}.fa-mars-stroke-h:before{content:""}.fa-neuter:before{content:""}.fa-genderless:before{content:""}.fa-facebook-official:before{content:""}.fa-pinterest-p:before{content:""}.fa-whatsapp:before{content:""}.fa-server:before{content:""}.fa-user-plus:before{content:""}.fa-user-times:before{content:""}.fa-bed:before,.fa-hotel:before{content:""}.fa-viacoin:before{content:""}.fa-train:before{content:""}.fa-subway:before{content:""}.fa-medium:before{content:""}.fa-y-combinator:before,.fa-yc:before{content:""}.fa-optin-monster:before{content:""}.fa-opencart:before{content:""}.fa-expeditedssl:before{content:""}.fa-battery-4:before,.fa-battery-full:before,.fa-battery:before{content:""}.fa-battery-3:before,.fa-battery-three-quarters:before{content:""}.fa-battery-2:before,.fa-battery-half:before{content:""}.fa-battery-1:before,.fa-battery-quarter:before{content:""}.fa-battery-0:before,.fa-battery-empty:before{content:""}.fa-mouse-pointer:before{content:""}.fa-i-cursor:before{content:""}.fa-object-group:before{content:""}.fa-object-ungroup:before{content:""}.fa-sticky-note:before{content:""}.fa-sticky-note-o:before{content:""}.fa-cc-jcb:before{content:""}.fa-cc-diners-club:before{content:""}.fa-clone:before{content:""}.fa-balance-scale:before{content:""}.fa-hourglass-o:before{content:""}.fa-hourglass-1:before,.fa-hourglass-start:before{content:""}.fa-hourglass-2:before,.fa-hourglass-half:before{content:""}.fa-hourglass-3:before,.fa-hourglass-end:before{content:""}.fa-hourglass:before{content:""}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:""}.fa-hand-paper-o:before,.fa-hand-stop-o:before{content:""}.fa-hand-scissors-o:before{content:""}.fa-hand-lizard-o:before{content:""}.fa-hand-spock-o:before{content:""}.fa-hand-pointer-o:before{content:""}.fa-hand-peace-o:before{content:""}.fa-trademark:before{content:""}.fa-registered:before{content:""}.fa-creative-commons:before{content:""}.fa-gg:before{content:""}.fa-gg-circle:before{content:""}.fa-tripadvisor:before{content:""}.fa-odnoklassniki:before{content:""}.fa-odnoklassniki-square:before{content:""}.fa-get-pocket:before{content:""}.fa-wikipedia-w:before{content:""}.fa-safari:before{content:""}.fa-chrome:before{content:""}.fa-firefox:before{content:""}.fa-opera:before{content:""}.fa-internet-explorer:before{content:""}.fa-television:before,.fa-tv:before{content:""}.fa-contao:before{content:""}.fa-500px:before{content:""}.fa-amazon:before{content:""}.fa-calendar-plus-o:before{content:""}.fa-calendar-minus-o:before{content:""}.fa-calendar-times-o:before{content:""}.fa-calendar-check-o:before{content:""}.fa-industry:before{content:""}.fa-map-pin:before{content:""}.fa-map-signs:before{content:""}.fa-map-o:before{content:""}.fa-map:before{content:""}.fa-commenting:before{content:""}.fa-commenting-o:before{content:""}.fa-houzz:before{content:""}.fa-vimeo:before{content:""}.fa-black-tie:before{content:""}.fa-fonticons:before{content:""}.fa-reddit-alien:before{content:""}.fa-edge:before{content:""}.fa-credit-card-alt:before{content:""}.fa-codiepie:before{content:""}.fa-modx:before{content:""}.fa-fort-awesome:before{content:""}.fa-usb:before{content:""}.fa-product-hunt:before{content:""}.fa-mixcloud:before{content:""}.fa-scribd:before{content:""}.fa-pause-circle:before{content:""}.fa-pause-circle-o:before{content:""}.fa-stop-circle:before{content:""}.fa-stop-circle-o:before{content:""}.fa-shopping-bag:before{content:""}.fa-shopping-basket:before{content:""}.fa-hashtag:before{content:""}.fa-bluetooth:before{content:""}.fa-bluetooth-b:before{content:""}.fa-percent:before{content:""}.fa-gitlab:before,.icon-gitlab:before{content:""}.fa-wpbeginner:before{content:""}.fa-wpforms:before{content:""}.fa-envira:before{content:""}.fa-universal-access:before{content:""}.fa-wheelchair-alt:before{content:""}.fa-question-circle-o:before{content:""}.fa-blind:before{content:""}.fa-audio-description:before{content:""}.fa-volume-control-phone:before{content:""}.fa-braille:before{content:""}.fa-assistive-listening-systems:before{content:""}.fa-american-sign-language-interpreting:before,.fa-asl-interpreting:before{content:""}.fa-deaf:before,.fa-deafness:before,.fa-hard-of-hearing:before{content:""}.fa-glide:before{content:""}.fa-glide-g:before{content:""}.fa-sign-language:before,.fa-signing:before{content:""}.fa-low-vision:before{content:""}.fa-viadeo:before{content:""}.fa-viadeo-square:before{content:""}.fa-snapchat:before{content:""}.fa-snapchat-ghost:before{content:""}.fa-snapchat-square:before{content:""}.fa-pied-piper:before{content:""}.fa-first-order:before{content:""}.fa-yoast:before{content:""}.fa-themeisle:before{content:""}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:""}.fa-fa:before,.fa-font-awesome:before{content:""}.fa-handshake-o:before{content:""}.fa-envelope-open:before{content:""}.fa-envelope-open-o:before{content:""}.fa-linode:before{content:""}.fa-address-book:before{content:""}.fa-address-book-o:before{content:""}.fa-address-card:before,.fa-vcard:before{content:""}.fa-address-card-o:before,.fa-vcard-o:before{content:""}.fa-user-circle:before{content:""}.fa-user-circle-o:before{content:""}.fa-user-o:before{content:""}.fa-id-badge:before{content:""}.fa-drivers-license:before,.fa-id-card:before{content:""}.fa-drivers-license-o:before,.fa-id-card-o:before{content:""}.fa-quora:before{content:""}.fa-free-code-camp:before{content:""}.fa-telegram:before{content:""}.fa-thermometer-4:before,.fa-thermometer-full:before,.fa-thermometer:before{content:""}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:""}.fa-thermometer-2:before,.fa-thermometer-half:before{content:""}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:""}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:""}.fa-shower:before{content:""}.fa-bath:before,.fa-bathtub:before,.fa-s15:before{content:""}.fa-podcast:before{content:""}.fa-window-maximize:before{content:""}.fa-window-minimize:before{content:""}.fa-window-restore:before{content:""}.fa-times-rectangle:before,.fa-window-close:before{content:""}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:""}.fa-bandcamp:before{content:""}.fa-grav:before{content:""}.fa-etsy:before{content:""}.fa-imdb:before{content:""}.fa-ravelry:before{content:""}.fa-eercast:before{content:""}.fa-microchip:before{content:""}.fa-snowflake-o:before{content:""}.fa-superpowers:before{content:""}.fa-wpexplorer:before{content:""}.fa-meetup:before{content:""}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.fa,.icon,.rst-content .admonition-title,.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content code.download span:first-child,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink,.rst-content tt.download span:first-child,.wy-dropdown .caret,.wy-inline-validate.wy-inline-validate-danger .wy-input-context,.wy-inline-validate.wy-inline-validate-info .wy-input-context,.wy-inline-validate.wy-inline-validate-success .wy-input-context,.wy-inline-validate.wy-inline-validate-warning .wy-input-context,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li button.toctree-expand{font-family:inherit}.fa:before,.icon:before,.rst-content .admonition-title:before,.rst-content .code-block-caption .headerlink:before,.rst-content .eqno .headerlink:before,.rst-content code.download span:first-child:before,.rst-content dl dt .headerlink:before,.rst-content h1 .headerlink:before,.rst-content h2 .headerlink:before,.rst-content h3 .headerlink:before,.rst-content h4 .headerlink:before,.rst-content h5 .headerlink:before,.rst-content h6 .headerlink:before,.rst-content p.caption .headerlink:before,.rst-content p .headerlink:before,.rst-content table>caption .headerlink:before,.rst-content tt.download span:first-child:before,.wy-dropdown .caret:before,.wy-inline-validate.wy-inline-validate-danger .wy-input-context:before,.wy-inline-validate.wy-inline-validate-info .wy-input-context:before,.wy-inline-validate.wy-inline-validate-success .wy-input-context:before,.wy-inline-validate.wy-inline-validate-warning .wy-input-context:before,.wy-menu-vertical li.current>a button.toctree-expand:before,.wy-menu-vertical li.on a button.toctree-expand:before,.wy-menu-vertical li button.toctree-expand:before{font-family:FontAwesome;display:inline-block;font-style:normal;font-weight:400;line-height:1;text-decoration:inherit}.rst-content .code-block-caption a .headerlink,.rst-content .eqno a .headerlink,.rst-content a .admonition-title,.rst-content code.download a span:first-child,.rst-content dl dt a .headerlink,.rst-content h1 a .headerlink,.rst-content h2 a .headerlink,.rst-content h3 a .headerlink,.rst-content h4 a .headerlink,.rst-content h5 a .headerlink,.rst-content h6 a .headerlink,.rst-content p.caption a .headerlink,.rst-content p a .headerlink,.rst-content table>caption a .headerlink,.rst-content tt.download a span:first-child,.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand,.wy-menu-vertical li a button.toctree-expand,a .fa,a .icon,a .rst-content .admonition-title,a .rst-content .code-block-caption .headerlink,a .rst-content .eqno .headerlink,a .rst-content code.download span:first-child,a .rst-content dl dt .headerlink,a .rst-content h1 .headerlink,a .rst-content h2 .headerlink,a .rst-content h3 .headerlink,a .rst-content h4 .headerlink,a .rst-content h5 .headerlink,a .rst-content h6 .headerlink,a .rst-content p.caption .headerlink,a .rst-content p .headerlink,a .rst-content table>caption .headerlink,a .rst-content tt.download span:first-child,a .wy-menu-vertical li button.toctree-expand{display:inline-block;text-decoration:inherit}.btn .fa,.btn .icon,.btn .rst-content .admonition-title,.btn .rst-content .code-block-caption .headerlink,.btn .rst-content .eqno .headerlink,.btn .rst-content code.download span:first-child,.btn .rst-content dl dt .headerlink,.btn .rst-content h1 .headerlink,.btn .rst-content h2 .headerlink,.btn .rst-content h3 .headerlink,.btn .rst-content h4 .headerlink,.btn .rst-content h5 .headerlink,.btn .rst-content h6 .headerlink,.btn .rst-content p .headerlink,.btn .rst-content table>caption .headerlink,.btn .rst-content tt.download span:first-child,.btn .wy-menu-vertical li.current>a button.toctree-expand,.btn .wy-menu-vertical li.on a button.toctree-expand,.btn .wy-menu-vertical li button.toctree-expand,.nav .fa,.nav .icon,.nav .rst-content .admonition-title,.nav .rst-content .code-block-caption .headerlink,.nav .rst-content .eqno .headerlink,.nav .rst-content code.download span:first-child,.nav .rst-content dl dt .headerlink,.nav .rst-content h1 .headerlink,.nav .rst-content h2 .headerlink,.nav .rst-content h3 .headerlink,.nav .rst-content h4 .headerlink,.nav .rst-content h5 .headerlink,.nav .rst-content h6 .headerlink,.nav .rst-content p .headerlink,.nav .rst-content table>caption .headerlink,.nav .rst-content tt.download span:first-child,.nav .wy-menu-vertical li.current>a button.toctree-expand,.nav .wy-menu-vertical li.on a button.toctree-expand,.nav .wy-menu-vertical li button.toctree-expand,.rst-content .btn .admonition-title,.rst-content .code-block-caption .btn .headerlink,.rst-content .code-block-caption .nav .headerlink,.rst-content .eqno .btn .headerlink,.rst-content .eqno .nav .headerlink,.rst-content .nav .admonition-title,.rst-content code.download .btn span:first-child,.rst-content code.download .nav span:first-child,.rst-content dl dt .btn .headerlink,.rst-content dl dt .nav .headerlink,.rst-content h1 .btn .headerlink,.rst-content h1 .nav .headerlink,.rst-content h2 .btn .headerlink,.rst-content h2 .nav .headerlink,.rst-content h3 .btn .headerlink,.rst-content h3 .nav .headerlink,.rst-content h4 .btn .headerlink,.rst-content h4 .nav .headerlink,.rst-content h5 .btn .headerlink,.rst-content h5 .nav .headerlink,.rst-content h6 .btn .headerlink,.rst-content h6 .nav .headerlink,.rst-content p .btn .headerlink,.rst-content p .nav .headerlink,.rst-content table>caption .btn .headerlink,.rst-content table>caption .nav .headerlink,.rst-content tt.download .btn span:first-child,.rst-content tt.download .nav span:first-child,.wy-menu-vertical li .btn button.toctree-expand,.wy-menu-vertical li.current>a .btn button.toctree-expand,.wy-menu-vertical li.current>a .nav button.toctree-expand,.wy-menu-vertical li .nav button.toctree-expand,.wy-menu-vertical li.on a .btn button.toctree-expand,.wy-menu-vertical li.on a .nav button.toctree-expand{display:inline}.btn .fa-large.icon,.btn .fa.fa-large,.btn .rst-content .code-block-caption .fa-large.headerlink,.btn .rst-content .eqno .fa-large.headerlink,.btn .rst-content .fa-large.admonition-title,.btn .rst-content code.download span.fa-large:first-child,.btn .rst-content dl dt .fa-large.headerlink,.btn .rst-content h1 .fa-large.headerlink,.btn .rst-content h2 .fa-large.headerlink,.btn .rst-content h3 .fa-large.headerlink,.btn .rst-content h4 .fa-large.headerlink,.btn .rst-content h5 .fa-large.headerlink,.btn .rst-content h6 .fa-large.headerlink,.btn .rst-content p .fa-large.headerlink,.btn .rst-content table>caption .fa-large.headerlink,.btn .rst-content tt.download span.fa-large:first-child,.btn .wy-menu-vertical li button.fa-large.toctree-expand,.nav .fa-large.icon,.nav .fa.fa-large,.nav .rst-content .code-block-caption .fa-large.headerlink,.nav .rst-content .eqno .fa-large.headerlink,.nav .rst-content .fa-large.admonition-title,.nav .rst-content code.download span.fa-large:first-child,.nav .rst-content dl dt .fa-large.headerlink,.nav .rst-content h1 .fa-large.headerlink,.nav .rst-content h2 .fa-large.headerlink,.nav .rst-content h3 .fa-large.headerlink,.nav .rst-content h4 .fa-large.headerlink,.nav .rst-content h5 .fa-large.headerlink,.nav .rst-content h6 .fa-large.headerlink,.nav .rst-content p .fa-large.headerlink,.nav .rst-content table>caption .fa-large.headerlink,.nav .rst-content tt.download span.fa-large:first-child,.nav .wy-menu-vertical li button.fa-large.toctree-expand,.rst-content .btn .fa-large.admonition-title,.rst-content .code-block-caption .btn .fa-large.headerlink,.rst-content .code-block-caption .nav .fa-large.headerlink,.rst-content .eqno .btn .fa-large.headerlink,.rst-content .eqno .nav .fa-large.headerlink,.rst-content .nav .fa-large.admonition-title,.rst-content code.download .btn span.fa-large:first-child,.rst-content code.download .nav span.fa-large:first-child,.rst-content dl dt .btn .fa-large.headerlink,.rst-content dl dt .nav .fa-large.headerlink,.rst-content h1 .btn .fa-large.headerlink,.rst-content h1 .nav .fa-large.headerlink,.rst-content h2 .btn .fa-large.headerlink,.rst-content h2 .nav .fa-large.headerlink,.rst-content h3 .btn .fa-large.headerlink,.rst-content h3 .nav .fa-large.headerlink,.rst-content h4 .btn .fa-large.headerlink,.rst-content h4 .nav .fa-large.headerlink,.rst-content h5 .btn .fa-large.headerlink,.rst-content h5 .nav .fa-large.headerlink,.rst-content h6 .btn .fa-large.headerlink,.rst-content h6 .nav .fa-large.headerlink,.rst-content p .btn .fa-large.headerlink,.rst-content p .nav .fa-large.headerlink,.rst-content table>caption .btn .fa-large.headerlink,.rst-content table>caption .nav .fa-large.headerlink,.rst-content tt.download .btn span.fa-large:first-child,.rst-content tt.download .nav span.fa-large:first-child,.wy-menu-vertical li .btn button.fa-large.toctree-expand,.wy-menu-vertical li .nav button.fa-large.toctree-expand{line-height:.9em}.btn .fa-spin.icon,.btn .fa.fa-spin,.btn .rst-content .code-block-caption .fa-spin.headerlink,.btn .rst-content .eqno .fa-spin.headerlink,.btn .rst-content .fa-spin.admonition-title,.btn .rst-content code.download span.fa-spin:first-child,.btn .rst-content dl dt .fa-spin.headerlink,.btn .rst-content h1 .fa-spin.headerlink,.btn .rst-content h2 .fa-spin.headerlink,.btn .rst-content h3 .fa-spin.headerlink,.btn .rst-content h4 .fa-spin.headerlink,.btn .rst-content h5 .fa-spin.headerlink,.btn .rst-content h6 .fa-spin.headerlink,.btn .rst-content p .fa-spin.headerlink,.btn .rst-content table>caption .fa-spin.headerlink,.btn .rst-content tt.download span.fa-spin:first-child,.btn .wy-menu-vertical li button.fa-spin.toctree-expand,.nav .fa-spin.icon,.nav .fa.fa-spin,.nav .rst-content .code-block-caption .fa-spin.headerlink,.nav .rst-content .eqno .fa-spin.headerlink,.nav .rst-content .fa-spin.admonition-title,.nav .rst-content code.download span.fa-spin:first-child,.nav .rst-content dl dt .fa-spin.headerlink,.nav .rst-content h1 .fa-spin.headerlink,.nav .rst-content h2 .fa-spin.headerlink,.nav .rst-content h3 .fa-spin.headerlink,.nav .rst-content h4 .fa-spin.headerlink,.nav .rst-content h5 .fa-spin.headerlink,.nav .rst-content h6 .fa-spin.headerlink,.nav .rst-content p .fa-spin.headerlink,.nav .rst-content table>caption .fa-spin.headerlink,.nav .rst-content tt.download span.fa-spin:first-child,.nav .wy-menu-vertical li button.fa-spin.toctree-expand,.rst-content .btn .fa-spin.admonition-title,.rst-content .code-block-caption .btn .fa-spin.headerlink,.rst-content .code-block-caption .nav .fa-spin.headerlink,.rst-content .eqno .btn .fa-spin.headerlink,.rst-content .eqno .nav .fa-spin.headerlink,.rst-content .nav .fa-spin.admonition-title,.rst-content code.download .btn span.fa-spin:first-child,.rst-content code.download .nav span.fa-spin:first-child,.rst-content dl dt .btn .fa-spin.headerlink,.rst-content dl dt .nav .fa-spin.headerlink,.rst-content h1 .btn .fa-spin.headerlink,.rst-content h1 .nav .fa-spin.headerlink,.rst-content h2 .btn .fa-spin.headerlink,.rst-content h2 .nav .fa-spin.headerlink,.rst-content h3 .btn .fa-spin.headerlink,.rst-content h3 .nav .fa-spin.headerlink,.rst-content h4 .btn .fa-spin.headerlink,.rst-content h4 .nav .fa-spin.headerlink,.rst-content h5 .btn .fa-spin.headerlink,.rst-content h5 .nav .fa-spin.headerlink,.rst-content h6 .btn .fa-spin.headerlink,.rst-content h6 .nav .fa-spin.headerlink,.rst-content p .btn .fa-spin.headerlink,.rst-content p .nav .fa-spin.headerlink,.rst-content table>caption .btn .fa-spin.headerlink,.rst-content table>caption .nav .fa-spin.headerlink,.rst-content tt.download .btn span.fa-spin:first-child,.rst-content tt.download .nav span.fa-spin:first-child,.wy-menu-vertical li .btn button.fa-spin.toctree-expand,.wy-menu-vertical li .nav button.fa-spin.toctree-expand{display:inline-block}.btn.fa:before,.btn.icon:before,.rst-content .btn.admonition-title:before,.rst-content .code-block-caption .btn.headerlink:before,.rst-content .eqno .btn.headerlink:before,.rst-content code.download span.btn:first-child:before,.rst-content dl dt .btn.headerlink:before,.rst-content h1 .btn.headerlink:before,.rst-content h2 .btn.headerlink:before,.rst-content h3 .btn.headerlink:before,.rst-content h4 .btn.headerlink:before,.rst-content h5 .btn.headerlink:before,.rst-content h6 .btn.headerlink:before,.rst-content p .btn.headerlink:before,.rst-content table>caption .btn.headerlink:before,.rst-content tt.download span.btn:first-child:before,.wy-menu-vertical li button.btn.toctree-expand:before{opacity:.5;-webkit-transition:opacity .05s ease-in;-moz-transition:opacity .05s ease-in;transition:opacity .05s ease-in}.btn.fa:hover:before,.btn.icon:hover:before,.rst-content .btn.admonition-title:hover:before,.rst-content .code-block-caption .btn.headerlink:hover:before,.rst-content .eqno .btn.headerlink:hover:before,.rst-content code.download span.btn:first-child:hover:before,.rst-content dl dt .btn.headerlink:hover:before,.rst-content h1 .btn.headerlink:hover:before,.rst-content h2 .btn.headerlink:hover:before,.rst-content h3 .btn.headerlink:hover:before,.rst-content h4 .btn.headerlink:hover:before,.rst-content h5 .btn.headerlink:hover:before,.rst-content h6 .btn.headerlink:hover:before,.rst-content p .btn.headerlink:hover:before,.rst-content table>caption .btn.headerlink:hover:before,.rst-content tt.download span.btn:first-child:hover:before,.wy-menu-vertical li button.btn.toctree-expand:hover:before{opacity:1}.btn-mini .fa:before,.btn-mini .icon:before,.btn-mini .rst-content .admonition-title:before,.btn-mini .rst-content .code-block-caption .headerlink:before,.btn-mini .rst-content .eqno .headerlink:before,.btn-mini .rst-content code.download span:first-child:before,.btn-mini .rst-content dl dt .headerlink:before,.btn-mini .rst-content h1 .headerlink:before,.btn-mini .rst-content h2 .headerlink:before,.btn-mini .rst-content h3 .headerlink:before,.btn-mini .rst-content h4 .headerlink:before,.btn-mini .rst-content h5 .headerlink:before,.btn-mini .rst-content h6 .headerlink:before,.btn-mini .rst-content p .headerlink:before,.btn-mini .rst-content table>caption .headerlink:before,.btn-mini .rst-content tt.download span:first-child:before,.btn-mini .wy-menu-vertical li button.toctree-expand:before,.rst-content .btn-mini .admonition-title:before,.rst-content .code-block-caption .btn-mini .headerlink:before,.rst-content .eqno .btn-mini .headerlink:before,.rst-content code.download .btn-mini span:first-child:before,.rst-content dl dt .btn-mini .headerlink:before,.rst-content h1 .btn-mini .headerlink:before,.rst-content h2 .btn-mini .headerlink:before,.rst-content h3 .btn-mini .headerlink:before,.rst-content h4 .btn-mini .headerlink:before,.rst-content h5 .btn-mini .headerlink:before,.rst-content h6 .btn-mini .headerlink:before,.rst-content p .btn-mini .headerlink:before,.rst-content table>caption .btn-mini .headerlink:before,.rst-content tt.download .btn-mini span:first-child:before,.wy-menu-vertical li .btn-mini button.toctree-expand:before{font-size:14px;vertical-align:-15%}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning,.wy-alert{padding:12px;line-height:24px;margin-bottom:24px;background:#e7f2fa}.rst-content .admonition-title,.wy-alert-title{font-weight:700;display:block;color:#fff;background:#6ab0de;padding:6px 12px;margin:-12px -12px 12px}.rst-content .danger,.rst-content .error,.rst-content .wy-alert-danger.admonition,.rst-content .wy-alert-danger.admonition-todo,.rst-content .wy-alert-danger.attention,.rst-content .wy-alert-danger.caution,.rst-content .wy-alert-danger.hint,.rst-content .wy-alert-danger.important,.rst-content .wy-alert-danger.note,.rst-content .wy-alert-danger.seealso,.rst-content .wy-alert-danger.tip,.rst-content .wy-alert-danger.warning,.wy-alert.wy-alert-danger{background:#fdf3f2}.rst-content .danger .admonition-title,.rst-content .danger .wy-alert-title,.rst-content .error .admonition-title,.rst-content .error .wy-alert-title,.rst-content .wy-alert-danger.admonition-todo .admonition-title,.rst-content .wy-alert-danger.admonition-todo .wy-alert-title,.rst-content .wy-alert-danger.admonition .admonition-title,.rst-content .wy-alert-danger.admonition .wy-alert-title,.rst-content .wy-alert-danger.attention .admonition-title,.rst-content .wy-alert-danger.attention .wy-alert-title,.rst-content .wy-alert-danger.caution .admonition-title,.rst-content .wy-alert-danger.caution .wy-alert-title,.rst-content .wy-alert-danger.hint .admonition-title,.rst-content .wy-alert-danger.hint .wy-alert-title,.rst-content .wy-alert-danger.important .admonition-title,.rst-content .wy-alert-danger.important .wy-alert-title,.rst-content .wy-alert-danger.note .admonition-title,.rst-content .wy-alert-danger.note .wy-alert-title,.rst-content .wy-alert-danger.seealso .admonition-title,.rst-content .wy-alert-danger.seealso .wy-alert-title,.rst-content .wy-alert-danger.tip .admonition-title,.rst-content .wy-alert-danger.tip .wy-alert-title,.rst-content .wy-alert-danger.warning .admonition-title,.rst-content .wy-alert-danger.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-danger .admonition-title,.wy-alert.wy-alert-danger .rst-content .admonition-title,.wy-alert.wy-alert-danger .wy-alert-title{background:#f29f97}.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .warning,.rst-content .wy-alert-warning.admonition,.rst-content .wy-alert-warning.danger,.rst-content .wy-alert-warning.error,.rst-content .wy-alert-warning.hint,.rst-content .wy-alert-warning.important,.rst-content .wy-alert-warning.note,.rst-content .wy-alert-warning.seealso,.rst-content .wy-alert-warning.tip,.wy-alert.wy-alert-warning{background:#ffedcc}.rst-content .admonition-todo .admonition-title,.rst-content .admonition-todo .wy-alert-title,.rst-content .attention .admonition-title,.rst-content .attention .wy-alert-title,.rst-content .caution .admonition-title,.rst-content .caution .wy-alert-title,.rst-content .warning .admonition-title,.rst-content .warning .wy-alert-title,.rst-content .wy-alert-warning.admonition .admonition-title,.rst-content .wy-alert-warning.admonition .wy-alert-title,.rst-content .wy-alert-warning.danger .admonition-title,.rst-content .wy-alert-warning.danger .wy-alert-title,.rst-content .wy-alert-warning.error .admonition-title,.rst-content .wy-alert-warning.error .wy-alert-title,.rst-content .wy-alert-warning.hint .admonition-title,.rst-content .wy-alert-warning.hint .wy-alert-title,.rst-content .wy-alert-warning.important .admonition-title,.rst-content .wy-alert-warning.important .wy-alert-title,.rst-content .wy-alert-warning.note .admonition-title,.rst-content .wy-alert-warning.note .wy-alert-title,.rst-content .wy-alert-warning.seealso .admonition-title,.rst-content .wy-alert-warning.seealso .wy-alert-title,.rst-content .wy-alert-warning.tip .admonition-title,.rst-content .wy-alert-warning.tip .wy-alert-title,.rst-content .wy-alert.wy-alert-warning .admonition-title,.wy-alert.wy-alert-warning .rst-content .admonition-title,.wy-alert.wy-alert-warning .wy-alert-title{background:#f0b37e}.rst-content .note,.rst-content .seealso,.rst-content .wy-alert-info.admonition,.rst-content .wy-alert-info.admonition-todo,.rst-content .wy-alert-info.attention,.rst-content .wy-alert-info.caution,.rst-content .wy-alert-info.danger,.rst-content .wy-alert-info.error,.rst-content .wy-alert-info.hint,.rst-content .wy-alert-info.important,.rst-content .wy-alert-info.tip,.rst-content .wy-alert-info.warning,.wy-alert.wy-alert-info{background:#e7f2fa}.rst-content .note .admonition-title,.rst-content .note .wy-alert-title,.rst-content .seealso .admonition-title,.rst-content .seealso .wy-alert-title,.rst-content .wy-alert-info.admonition-todo .admonition-title,.rst-content .wy-alert-info.admonition-todo .wy-alert-title,.rst-content .wy-alert-info.admonition .admonition-title,.rst-content .wy-alert-info.admonition .wy-alert-title,.rst-content .wy-alert-info.attention .admonition-title,.rst-content .wy-alert-info.attention .wy-alert-title,.rst-content .wy-alert-info.caution .admonition-title,.rst-content .wy-alert-info.caution .wy-alert-title,.rst-content .wy-alert-info.danger .admonition-title,.rst-content .wy-alert-info.danger .wy-alert-title,.rst-content .wy-alert-info.error .admonition-title,.rst-content .wy-alert-info.error .wy-alert-title,.rst-content .wy-alert-info.hint .admonition-title,.rst-content .wy-alert-info.hint .wy-alert-title,.rst-content .wy-alert-info.important .admonition-title,.rst-content .wy-alert-info.important .wy-alert-title,.rst-content .wy-alert-info.tip .admonition-title,.rst-content .wy-alert-info.tip .wy-alert-title,.rst-content .wy-alert-info.warning .admonition-title,.rst-content .wy-alert-info.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-info .admonition-title,.wy-alert.wy-alert-info .rst-content .admonition-title,.wy-alert.wy-alert-info .wy-alert-title{background:#6ab0de}.rst-content .hint,.rst-content .important,.rst-content .tip,.rst-content .wy-alert-success.admonition,.rst-content .wy-alert-success.admonition-todo,.rst-content .wy-alert-success.attention,.rst-content .wy-alert-success.caution,.rst-content .wy-alert-success.danger,.rst-content .wy-alert-success.error,.rst-content .wy-alert-success.note,.rst-content .wy-alert-success.seealso,.rst-content .wy-alert-success.warning,.wy-alert.wy-alert-success{background:#dbfaf4}.rst-content .hint .admonition-title,.rst-content .hint .wy-alert-title,.rst-content .important .admonition-title,.rst-content .important .wy-alert-title,.rst-content .tip .admonition-title,.rst-content .tip .wy-alert-title,.rst-content .wy-alert-success.admonition-todo .admonition-title,.rst-content .wy-alert-success.admonition-todo .wy-alert-title,.rst-content .wy-alert-success.admonition .admonition-title,.rst-content .wy-alert-success.admonition .wy-alert-title,.rst-content .wy-alert-success.attention .admonition-title,.rst-content .wy-alert-success.attention .wy-alert-title,.rst-content .wy-alert-success.caution .admonition-title,.rst-content .wy-alert-success.caution .wy-alert-title,.rst-content .wy-alert-success.danger .admonition-title,.rst-content .wy-alert-success.danger .wy-alert-title,.rst-content .wy-alert-success.error .admonition-title,.rst-content .wy-alert-success.error .wy-alert-title,.rst-content .wy-alert-success.note .admonition-title,.rst-content .wy-alert-success.note .wy-alert-title,.rst-content .wy-alert-success.seealso .admonition-title,.rst-content .wy-alert-success.seealso .wy-alert-title,.rst-content .wy-alert-success.warning .admonition-title,.rst-content .wy-alert-success.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-success .admonition-title,.wy-alert.wy-alert-success .rst-content .admonition-title,.wy-alert.wy-alert-success .wy-alert-title{background:#1abc9c}.rst-content .wy-alert-neutral.admonition,.rst-content .wy-alert-neutral.admonition-todo,.rst-content .wy-alert-neutral.attention,.rst-content .wy-alert-neutral.caution,.rst-content .wy-alert-neutral.danger,.rst-content .wy-alert-neutral.error,.rst-content .wy-alert-neutral.hint,.rst-content .wy-alert-neutral.important,.rst-content .wy-alert-neutral.note,.rst-content .wy-alert-neutral.seealso,.rst-content .wy-alert-neutral.tip,.rst-content .wy-alert-neutral.warning,.wy-alert.wy-alert-neutral{background:#f3f6f6}.rst-content .wy-alert-neutral.admonition-todo .admonition-title,.rst-content .wy-alert-neutral.admonition-todo .wy-alert-title,.rst-content .wy-alert-neutral.admonition .admonition-title,.rst-content .wy-alert-neutral.admonition .wy-alert-title,.rst-content .wy-alert-neutral.attention .admonition-title,.rst-content .wy-alert-neutral.attention .wy-alert-title,.rst-content .wy-alert-neutral.caution .admonition-title,.rst-content .wy-alert-neutral.caution .wy-alert-title,.rst-content .wy-alert-neutral.danger .admonition-title,.rst-content .wy-alert-neutral.danger .wy-alert-title,.rst-content .wy-alert-neutral.error .admonition-title,.rst-content .wy-alert-neutral.error .wy-alert-title,.rst-content .wy-alert-neutral.hint .admonition-title,.rst-content .wy-alert-neutral.hint .wy-alert-title,.rst-content .wy-alert-neutral.important .admonition-title,.rst-content .wy-alert-neutral.important .wy-alert-title,.rst-content .wy-alert-neutral.note .admonition-title,.rst-content .wy-alert-neutral.note .wy-alert-title,.rst-content .wy-alert-neutral.seealso .admonition-title,.rst-content .wy-alert-neutral.seealso .wy-alert-title,.rst-content .wy-alert-neutral.tip .admonition-title,.rst-content .wy-alert-neutral.tip .wy-alert-title,.rst-content .wy-alert-neutral.warning .admonition-title,.rst-content .wy-alert-neutral.warning .wy-alert-title,.rst-content .wy-alert.wy-alert-neutral .admonition-title,.wy-alert.wy-alert-neutral .rst-content .admonition-title,.wy-alert.wy-alert-neutral .wy-alert-title{color:#404040;background:#e1e4e5}.rst-content .wy-alert-neutral.admonition-todo a,.rst-content .wy-alert-neutral.admonition a,.rst-content .wy-alert-neutral.attention a,.rst-content .wy-alert-neutral.caution a,.rst-content .wy-alert-neutral.danger a,.rst-content .wy-alert-neutral.error a,.rst-content .wy-alert-neutral.hint a,.rst-content .wy-alert-neutral.important a,.rst-content .wy-alert-neutral.note a,.rst-content .wy-alert-neutral.seealso a,.rst-content .wy-alert-neutral.tip a,.rst-content .wy-alert-neutral.warning a,.wy-alert.wy-alert-neutral a{color:#2980b9}.rst-content .admonition-todo p:last-child,.rst-content .admonition p:last-child,.rst-content .attention p:last-child,.rst-content .caution p:last-child,.rst-content .danger p:last-child,.rst-content .error p:last-child,.rst-content .hint p:last-child,.rst-content .important p:last-child,.rst-content .note p:last-child,.rst-content .seealso p:last-child,.rst-content .tip p:last-child,.rst-content .warning p:last-child,.wy-alert p:last-child{margin-bottom:0}.wy-tray-container{position:fixed;bottom:0;left:0;z-index:600}.wy-tray-container li{display:block;width:300px;background:transparent;color:#fff;text-align:center;box-shadow:0 5px 5px 0 rgba(0,0,0,.1);padding:0 24px;min-width:20%;opacity:0;height:0;line-height:56px;overflow:hidden;-webkit-transition:all .3s ease-in;-moz-transition:all .3s ease-in;transition:all .3s ease-in}.wy-tray-container li.wy-tray-item-success{background:#27ae60}.wy-tray-container li.wy-tray-item-info{background:#2980b9}.wy-tray-container li.wy-tray-item-warning{background:#e67e22}.wy-tray-container li.wy-tray-item-danger{background:#e74c3c}.wy-tray-container li.on{opacity:1;height:56px}@media screen and (max-width:768px){.wy-tray-container{bottom:auto;top:0;width:100%}.wy-tray-container li{width:100%}}button{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle;cursor:pointer;line-height:normal;-webkit-appearance:button;*overflow:visible}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button[disabled]{cursor:default}.btn{display:inline-block;border-radius:2px;line-height:normal;white-space:nowrap;text-align:center;cursor:pointer;font-size:100%;padding:6px 12px 8px;color:#fff;border:1px solid rgba(0,0,0,.1);background-color:#27ae60;text-decoration:none;font-weight:400;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 2px -1px hsla(0,0%,100%,.5),inset 0 -2px 0 0 rgba(0,0,0,.1);outline-none:false;vertical-align:middle;*display:inline;zoom:1;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-transition:all .1s linear;-moz-transition:all .1s linear;transition:all .1s linear}.btn-hover{background:#2e8ece;color:#fff}.btn:hover{background:#2cc36b;color:#fff}.btn:focus{background:#2cc36b;outline:0}.btn:active{box-shadow:inset 0 -1px 0 0 rgba(0,0,0,.05),inset 0 2px 0 0 rgba(0,0,0,.1);padding:8px 12px 6px}.btn:visited{color:#fff}.btn-disabled,.btn-disabled:active,.btn-disabled:focus,.btn-disabled:hover,.btn:disabled{background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);filter:alpha(opacity=40);opacity:.4;cursor:not-allowed;box-shadow:none}.btn::-moz-focus-inner{padding:0;border:0}.btn-small{font-size:80%}.btn-info{background-color:#2980b9!important}.btn-info:hover{background-color:#2e8ece!important}.btn-neutral{background-color:#f3f6f6!important;color:#404040!important}.btn-neutral:hover{background-color:#e5ebeb!important;color:#404040}.btn-neutral:visited{color:#404040!important}.btn-success{background-color:#27ae60!important}.btn-success:hover{background-color:#295!important}.btn-danger{background-color:#e74c3c!important}.btn-danger:hover{background-color:#ea6153!important}.btn-warning{background-color:#e67e22!important}.btn-warning:hover{background-color:#e98b39!important}.btn-invert{background-color:#222}.btn-invert:hover{background-color:#2f2f2f!important}.btn-link{background-color:transparent!important;color:#2980b9;box-shadow:none;border-color:transparent!important}.btn-link:active,.btn-link:hover{background-color:transparent!important;color:#409ad5!important;box-shadow:none}.btn-link:visited{color:#9b59b6}.wy-btn-group .btn,.wy-control .btn{vertical-align:middle}.wy-btn-group{margin-bottom:24px;*zoom:1}.wy-btn-group:after,.wy-btn-group:before{display:table;content:""}.wy-btn-group:after{clear:both}.wy-dropdown{position:relative;display:inline-block}.wy-dropdown-active .wy-dropdown-menu{display:block}.wy-dropdown-menu{position:absolute;left:0;display:none;float:left;top:100%;min-width:100%;background:#fcfcfc;z-index:100;border:1px solid #cfd7dd;box-shadow:0 2px 2px 0 rgba(0,0,0,.1);padding:12px}.wy-dropdown-menu>dd>a{display:block;clear:both;color:#404040;white-space:nowrap;font-size:90%;padding:0 12px;cursor:pointer}.wy-dropdown-menu>dd>a:hover{background:#2980b9;color:#fff}.wy-dropdown-menu>dd.divider{border-top:1px solid #cfd7dd;margin:6px 0}.wy-dropdown-menu>dd.search{padding-bottom:12px}.wy-dropdown-menu>dd.search input[type=search]{width:100%}.wy-dropdown-menu>dd.call-to-action{background:#e3e3e3;text-transform:uppercase;font-weight:500;font-size:80%}.wy-dropdown-menu>dd.call-to-action:hover{background:#e3e3e3}.wy-dropdown-menu>dd.call-to-action .btn{color:#fff}.wy-dropdown.wy-dropdown-up .wy-dropdown-menu{bottom:100%;top:auto;left:auto;right:0}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu{background:#fcfcfc;margin-top:2px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a{padding:6px 12px}.wy-dropdown.wy-dropdown-bubble .wy-dropdown-menu a:hover{background:#2980b9;color:#fff}.wy-dropdown.wy-dropdown-left .wy-dropdown-menu{right:0;left:auto;text-align:right}.wy-dropdown-arrow:before{content:" ";border-bottom:5px solid #f5f5f5;border-left:5px solid transparent;border-right:5px solid transparent;position:absolute;display:block;top:-4px;left:50%;margin-left:-3px}.wy-dropdown-arrow.wy-dropdown-arrow-left:before{left:11px}.wy-form-stacked select{display:block}.wy-form-aligned .wy-help-inline,.wy-form-aligned input,.wy-form-aligned label,.wy-form-aligned select,.wy-form-aligned textarea{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-form-aligned .wy-control-group>label{display:inline-block;vertical-align:middle;width:10em;margin:6px 12px 0 0;float:left}.wy-form-aligned .wy-control{float:left}.wy-form-aligned .wy-control label{display:block}.wy-form-aligned .wy-control select{margin-top:6px}fieldset{margin:0}fieldset,legend{border:0;padding:0}legend{width:100%;white-space:normal;margin-bottom:24px;font-size:150%;*margin-left:-7px}label,legend{display:block}label{margin:0 0 .3125em;color:#333;font-size:90%}input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}.wy-control-group{margin-bottom:24px;max-width:1200px;margin-left:auto;margin-right:auto;*zoom:1}.wy-control-group:after,.wy-control-group:before{display:table;content:""}.wy-control-group:after{clear:both}.wy-control-group.wy-control-group-required>label:after{content:" *";color:#e74c3c}.wy-control-group .wy-form-full,.wy-control-group .wy-form-halves,.wy-control-group .wy-form-thirds{padding-bottom:12px}.wy-control-group .wy-form-full input[type=color],.wy-control-group .wy-form-full input[type=date],.wy-control-group .wy-form-full input[type=datetime-local],.wy-control-group .wy-form-full input[type=datetime],.wy-control-group .wy-form-full input[type=email],.wy-control-group .wy-form-full input[type=month],.wy-control-group .wy-form-full input[type=number],.wy-control-group .wy-form-full input[type=password],.wy-control-group .wy-form-full input[type=search],.wy-control-group .wy-form-full input[type=tel],.wy-control-group .wy-form-full input[type=text],.wy-control-group .wy-form-full input[type=time],.wy-control-group .wy-form-full input[type=url],.wy-control-group .wy-form-full input[type=week],.wy-control-group .wy-form-full select,.wy-control-group .wy-form-halves input[type=color],.wy-control-group .wy-form-halves input[type=date],.wy-control-group .wy-form-halves input[type=datetime-local],.wy-control-group .wy-form-halves input[type=datetime],.wy-control-group .wy-form-halves input[type=email],.wy-control-group .wy-form-halves input[type=month],.wy-control-group .wy-form-halves input[type=number],.wy-control-group .wy-form-halves input[type=password],.wy-control-group .wy-form-halves input[type=search],.wy-control-group .wy-form-halves input[type=tel],.wy-control-group .wy-form-halves input[type=text],.wy-control-group .wy-form-halves input[type=time],.wy-control-group .wy-form-halves input[type=url],.wy-control-group .wy-form-halves input[type=week],.wy-control-group .wy-form-halves select,.wy-control-group .wy-form-thirds input[type=color],.wy-control-group .wy-form-thirds input[type=date],.wy-control-group .wy-form-thirds input[type=datetime-local],.wy-control-group .wy-form-thirds input[type=datetime],.wy-control-group .wy-form-thirds input[type=email],.wy-control-group .wy-form-thirds input[type=month],.wy-control-group .wy-form-thirds input[type=number],.wy-control-group .wy-form-thirds input[type=password],.wy-control-group .wy-form-thirds input[type=search],.wy-control-group .wy-form-thirds input[type=tel],.wy-control-group .wy-form-thirds input[type=text],.wy-control-group .wy-form-thirds input[type=time],.wy-control-group .wy-form-thirds input[type=url],.wy-control-group .wy-form-thirds input[type=week],.wy-control-group .wy-form-thirds select{width:100%}.wy-control-group .wy-form-full{float:left;display:block;width:100%;margin-right:0}.wy-control-group .wy-form-full:last-child{margin-right:0}.wy-control-group .wy-form-halves{float:left;display:block;margin-right:2.35765%;width:48.82117%}.wy-control-group .wy-form-halves:last-child,.wy-control-group .wy-form-halves:nth-of-type(2n){margin-right:0}.wy-control-group .wy-form-halves:nth-of-type(odd){clear:left}.wy-control-group .wy-form-thirds{float:left;display:block;margin-right:2.35765%;width:31.76157%}.wy-control-group .wy-form-thirds:last-child,.wy-control-group .wy-form-thirds:nth-of-type(3n){margin-right:0}.wy-control-group .wy-form-thirds:nth-of-type(3n+1){clear:left}.wy-control-group.wy-control-group-no-input .wy-control,.wy-control-no-input{margin:6px 0 0;font-size:90%}.wy-control-no-input{display:inline-block}.wy-control-group.fluid-input input[type=color],.wy-control-group.fluid-input input[type=date],.wy-control-group.fluid-input input[type=datetime-local],.wy-control-group.fluid-input input[type=datetime],.wy-control-group.fluid-input input[type=email],.wy-control-group.fluid-input input[type=month],.wy-control-group.fluid-input input[type=number],.wy-control-group.fluid-input input[type=password],.wy-control-group.fluid-input input[type=search],.wy-control-group.fluid-input input[type=tel],.wy-control-group.fluid-input input[type=text],.wy-control-group.fluid-input input[type=time],.wy-control-group.fluid-input input[type=url],.wy-control-group.fluid-input input[type=week]{width:100%}.wy-form-message-inline{padding-left:.3em;color:#666;font-size:90%}.wy-form-message{display:block;color:#999;font-size:70%;margin-top:.3125em;font-style:italic}.wy-form-message p{font-size:inherit;font-style:italic;margin-bottom:6px}.wy-form-message p:last-child{margin-bottom:0}input{line-height:normal}input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;*overflow:visible}input[type=color],input[type=date],input[type=datetime-local],input[type=datetime],input[type=email],input[type=month],input[type=number],input[type=password],input[type=search],input[type=tel],input[type=text],input[type=time],input[type=url],input[type=week]{-webkit-appearance:none;padding:6px;display:inline-block;border:1px solid #ccc;font-size:80%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;box-shadow:inset 0 1px 3px #ddd;border-radius:0;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}input[type=datetime-local]{padding:.34375em .625em}input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{padding:0;margin-right:.3125em;*height:13px;*width:13px}input[type=checkbox],input[type=radio],input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}input[type=color]:focus,input[type=date]:focus,input[type=datetime-local]:focus,input[type=datetime]:focus,input[type=email]:focus,input[type=month]:focus,input[type=number]:focus,input[type=password]:focus,input[type=search]:focus,input[type=tel]:focus,input[type=text]:focus,input[type=time]:focus,input[type=url]:focus,input[type=week]:focus{outline:0;outline:thin dotted\9;border-color:#333}input.no-focus:focus{border-color:#ccc!important}input[type=checkbox]:focus,input[type=file]:focus,input[type=radio]:focus{outline:thin dotted #333;outline:1px auto #129fea}input[type=color][disabled],input[type=date][disabled],input[type=datetime-local][disabled],input[type=datetime][disabled],input[type=email][disabled],input[type=month][disabled],input[type=number][disabled],input[type=password][disabled],input[type=search][disabled],input[type=tel][disabled],input[type=text][disabled],input[type=time][disabled],input[type=url][disabled],input[type=week][disabled]{cursor:not-allowed;background-color:#fafafa}input:focus:invalid,select:focus:invalid,textarea:focus:invalid{color:#e74c3c;border:1px solid #e74c3c}input:focus:invalid:focus,select:focus:invalid:focus,textarea:focus:invalid:focus{border-color:#e74c3c}input[type=checkbox]:focus:invalid:focus,input[type=file]:focus:invalid:focus,input[type=radio]:focus:invalid:focus{outline-color:#e74c3c}input.wy-input-large{padding:12px;font-size:100%}textarea{overflow:auto;vertical-align:top;width:100%;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif}select,textarea{padding:.5em .625em;display:inline-block;border:1px solid #ccc;font-size:80%;box-shadow:inset 0 1px 3px #ddd;-webkit-transition:border .3s linear;-moz-transition:border .3s linear;transition:border .3s linear}select{border:1px solid #ccc;background-color:#fff}select[multiple]{height:auto}select:focus,textarea:focus{outline:0}input[readonly],select[disabled],select[readonly],textarea[disabled],textarea[readonly]{cursor:not-allowed;background-color:#fafafa}input[type=checkbox][disabled],input[type=radio][disabled]{cursor:not-allowed}.wy-checkbox,.wy-radio{margin:6px 0;color:#404040;display:block}.wy-checkbox input,.wy-radio input{vertical-align:baseline}.wy-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.wy-input-prefix,.wy-input-suffix{white-space:nowrap;padding:6px}.wy-input-prefix .wy-input-context,.wy-input-suffix .wy-input-context{line-height:27px;padding:0 8px;display:inline-block;font-size:80%;background-color:#f3f6f6;border:1px solid #ccc;color:#999}.wy-input-suffix .wy-input-context{border-left:0}.wy-input-prefix .wy-input-context{border-right:0}.wy-switch{position:relative;display:block;height:24px;margin-top:12px;cursor:pointer}.wy-switch:before{left:0;top:0;width:36px;height:12px;background:#ccc}.wy-switch:after,.wy-switch:before{position:absolute;content:"";display:block;border-radius:4px;-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wy-switch:after{width:18px;height:18px;background:#999;left:-3px;top:-3px}.wy-switch span{position:absolute;left:48px;display:block;font-size:12px;color:#ccc;line-height:1}.wy-switch.active:before{background:#1e8449}.wy-switch.active:after{left:24px;background:#27ae60}.wy-switch.disabled{cursor:not-allowed;opacity:.8}.wy-control-group.wy-control-group-error .wy-form-message,.wy-control-group.wy-control-group-error>label{color:#e74c3c}.wy-control-group.wy-control-group-error input[type=color],.wy-control-group.wy-control-group-error input[type=date],.wy-control-group.wy-control-group-error input[type=datetime-local],.wy-control-group.wy-control-group-error input[type=datetime],.wy-control-group.wy-control-group-error input[type=email],.wy-control-group.wy-control-group-error input[type=month],.wy-control-group.wy-control-group-error input[type=number],.wy-control-group.wy-control-group-error input[type=password],.wy-control-group.wy-control-group-error input[type=search],.wy-control-group.wy-control-group-error input[type=tel],.wy-control-group.wy-control-group-error input[type=text],.wy-control-group.wy-control-group-error input[type=time],.wy-control-group.wy-control-group-error input[type=url],.wy-control-group.wy-control-group-error input[type=week],.wy-control-group.wy-control-group-error textarea{border:1px solid #e74c3c}.wy-inline-validate{white-space:nowrap}.wy-inline-validate .wy-input-context{padding:.5em .625em;display:inline-block;font-size:80%}.wy-inline-validate.wy-inline-validate-success .wy-input-context{color:#27ae60}.wy-inline-validate.wy-inline-validate-danger .wy-input-context{color:#e74c3c}.wy-inline-validate.wy-inline-validate-warning .wy-input-context{color:#e67e22}.wy-inline-validate.wy-inline-validate-info .wy-input-context{color:#2980b9}.rotate-90{-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.rotate-180{-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.rotate-270{-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.mirror{-webkit-transform:scaleX(-1);-moz-transform:scaleX(-1);-ms-transform:scaleX(-1);-o-transform:scaleX(-1);transform:scaleX(-1)}.mirror.rotate-90{-webkit-transform:scaleX(-1) rotate(90deg);-moz-transform:scaleX(-1) rotate(90deg);-ms-transform:scaleX(-1) rotate(90deg);-o-transform:scaleX(-1) rotate(90deg);transform:scaleX(-1) rotate(90deg)}.mirror.rotate-180{-webkit-transform:scaleX(-1) rotate(180deg);-moz-transform:scaleX(-1) rotate(180deg);-ms-transform:scaleX(-1) rotate(180deg);-o-transform:scaleX(-1) rotate(180deg);transform:scaleX(-1) rotate(180deg)}.mirror.rotate-270{-webkit-transform:scaleX(-1) rotate(270deg);-moz-transform:scaleX(-1) rotate(270deg);-ms-transform:scaleX(-1) rotate(270deg);-o-transform:scaleX(-1) rotate(270deg);transform:scaleX(-1) rotate(270deg)}@media only screen and (max-width:480px){.wy-form button[type=submit]{margin:.7em 0 0}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=text],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week],.wy-form label{margin-bottom:.3em;display:block}.wy-form input[type=color],.wy-form input[type=date],.wy-form input[type=datetime-local],.wy-form input[type=datetime],.wy-form input[type=email],.wy-form input[type=month],.wy-form input[type=number],.wy-form input[type=password],.wy-form input[type=search],.wy-form input[type=tel],.wy-form input[type=time],.wy-form input[type=url],.wy-form input[type=week]{margin-bottom:0}.wy-form-aligned .wy-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.wy-form-aligned .wy-control{margin:1.5em 0 0}.wy-form-message,.wy-form-message-inline,.wy-form .wy-help-inline{display:block;font-size:80%;padding:6px 0}}@media screen and (max-width:768px){.tablet-hide{display:none}}@media screen and (max-width:480px){.mobile-hide{display:none}}.float-left{float:left}.float-right{float:right}.full-width{width:100%}.rst-content table.docutils,.rst-content table.field-list,.wy-table{border-collapse:collapse;border-spacing:0;empty-cells:show;margin-bottom:24px}.rst-content table.docutils caption,.rst-content table.field-list caption,.wy-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.rst-content table.docutils td,.rst-content table.docutils th,.rst-content table.field-list td,.rst-content table.field-list th,.wy-table td,.wy-table th{font-size:90%;margin:0;overflow:visible;padding:8px 16px}.rst-content table.docutils td:first-child,.rst-content table.docutils th:first-child,.rst-content table.field-list td:first-child,.rst-content table.field-list th:first-child,.wy-table td:first-child,.wy-table th:first-child{border-left-width:0}.rst-content table.docutils thead,.rst-content table.field-list thead,.wy-table thead{color:#000;text-align:left;vertical-align:bottom;white-space:nowrap}.rst-content table.docutils thead th,.rst-content table.field-list thead th,.wy-table thead th{font-weight:700;border-bottom:2px solid #e1e4e5}.rst-content table.docutils td,.rst-content table.field-list td,.wy-table td{background-color:transparent;vertical-align:middle}.rst-content table.docutils td p,.rst-content table.field-list td p,.wy-table td p{line-height:18px}.rst-content table.docutils td p:last-child,.rst-content table.field-list td p:last-child,.wy-table td p:last-child{margin-bottom:0}.rst-content table.docutils .wy-table-cell-min,.rst-content table.field-list .wy-table-cell-min,.wy-table .wy-table-cell-min{width:1%;padding-right:0}.rst-content table.docutils .wy-table-cell-min input[type=checkbox],.rst-content table.field-list .wy-table-cell-min input[type=checkbox],.wy-table .wy-table-cell-min input[type=checkbox]{margin:0}.wy-table-secondary{color:grey;font-size:90%}.wy-table-tertiary{color:grey;font-size:80%}.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td,.wy-table-backed,.wy-table-odd td,.wy-table-striped tr:nth-child(2n-1) td{background-color:#f3f6f6}.rst-content table.docutils,.wy-table-bordered-all{border:1px solid #e1e4e5}.rst-content table.docutils td,.wy-table-bordered-all td{border-bottom:1px solid #e1e4e5;border-left:1px solid #e1e4e5}.rst-content table.docutils tbody>tr:last-child td,.wy-table-bordered-all tbody>tr:last-child td{border-bottom-width:0}.wy-table-bordered{border:1px solid #e1e4e5}.wy-table-bordered-rows td{border-bottom:1px solid #e1e4e5}.wy-table-bordered-rows tbody>tr:last-child td{border-bottom-width:0}.wy-table-horizontal td,.wy-table-horizontal th{border-width:0 0 1px;border-bottom:1px solid #e1e4e5}.wy-table-horizontal tbody>tr:last-child td{border-bottom-width:0}.wy-table-responsive{margin-bottom:24px;max-width:100%;overflow:auto}.wy-table-responsive table{margin-bottom:0!important}.wy-table-responsive table td,.wy-table-responsive table th{white-space:nowrap}a{color:#2980b9;text-decoration:none;cursor:pointer}a:hover{color:#3091d1}a:visited{color:#9b59b6}html{height:100%}body,html{overflow-x:hidden}body{font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;font-weight:400;color:#404040;min-height:100%;background:#edf0f2}.wy-text-left{text-align:left}.wy-text-center{text-align:center}.wy-text-right{text-align:right}.wy-text-large{font-size:120%}.wy-text-normal{font-size:100%}.wy-text-small,small{font-size:80%}.wy-text-strike{text-decoration:line-through}.wy-text-warning{color:#e67e22!important}a.wy-text-warning:hover{color:#eb9950!important}.wy-text-info{color:#2980b9!important}a.wy-text-info:hover{color:#409ad5!important}.wy-text-success{color:#27ae60!important}a.wy-text-success:hover{color:#36d278!important}.wy-text-danger{color:#e74c3c!important}a.wy-text-danger:hover{color:#ed7669!important}.wy-text-neutral{color:#404040!important}a.wy-text-neutral:hover{color:#595959!important}.rst-content .toctree-wrapper>p.caption,h1,h2,h3,h4,h5,h6,legend{margin-top:0;font-weight:700;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif}p{line-height:24px;font-size:16px;margin:0 0 24px}h1{font-size:175%}.rst-content .toctree-wrapper>p.caption,h2{font-size:150%}h3{font-size:125%}h4{font-size:115%}h5{font-size:110%}h6{font-size:100%}hr{display:block;height:1px;border:0;border-top:1px solid #e1e4e5;margin:24px 0;padding:0}.rst-content code,.rst-content tt,code{white-space:nowrap;max-width:100%;background:#fff;border:1px solid #e1e4e5;font-size:75%;padding:0 5px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#e74c3c;overflow-x:auto}.rst-content tt.code-large,code.code-large{font-size:90%}.rst-content .section ul,.rst-content .toctree-wrapper ul,.rst-content section ul,.wy-plain-list-disc,article ul{list-style:disc;line-height:24px;margin-bottom:24px}.rst-content .section ul li,.rst-content .toctree-wrapper ul li,.rst-content section ul li,.wy-plain-list-disc li,article ul li{list-style:disc;margin-left:24px}.rst-content .section ul li p:last-child,.rst-content .section ul li ul,.rst-content .toctree-wrapper ul li p:last-child,.rst-content .toctree-wrapper ul li ul,.rst-content section ul li p:last-child,.rst-content section ul li ul,.wy-plain-list-disc li p:last-child,.wy-plain-list-disc li ul,article ul li p:last-child,article ul li ul{margin-bottom:0}.rst-content .section ul li li,.rst-content .toctree-wrapper ul li li,.rst-content section ul li li,.wy-plain-list-disc li li,article ul li li{list-style:circle}.rst-content .section ul li li li,.rst-content .toctree-wrapper ul li li li,.rst-content section ul li li li,.wy-plain-list-disc li li li,article ul li li li{list-style:square}.rst-content .section ul li ol li,.rst-content .toctree-wrapper ul li ol li,.rst-content section ul li ol li,.wy-plain-list-disc li ol li,article ul li ol li{list-style:decimal}.rst-content .section ol,.rst-content .section ol.arabic,.rst-content .toctree-wrapper ol,.rst-content .toctree-wrapper ol.arabic,.rst-content section ol,.rst-content section ol.arabic,.wy-plain-list-decimal,article ol{list-style:decimal;line-height:24px;margin-bottom:24px}.rst-content .section ol.arabic li,.rst-content .section ol li,.rst-content .toctree-wrapper ol.arabic li,.rst-content .toctree-wrapper ol li,.rst-content section ol.arabic li,.rst-content section ol li,.wy-plain-list-decimal li,article ol li{list-style:decimal;margin-left:24px}.rst-content .section ol.arabic li ul,.rst-content .section ol li p:last-child,.rst-content .section ol li ul,.rst-content .toctree-wrapper ol.arabic li ul,.rst-content .toctree-wrapper ol li p:last-child,.rst-content .toctree-wrapper ol li ul,.rst-content section ol.arabic li ul,.rst-content section ol li p:last-child,.rst-content section ol li ul,.wy-plain-list-decimal li p:last-child,.wy-plain-list-decimal li ul,article ol li p:last-child,article ol li ul{margin-bottom:0}.rst-content .section ol.arabic li ul li,.rst-content .section ol li ul li,.rst-content .toctree-wrapper ol.arabic li ul li,.rst-content .toctree-wrapper ol li ul li,.rst-content section ol.arabic li ul li,.rst-content section ol li ul li,.wy-plain-list-decimal li ul li,article ol li ul li{list-style:disc}.wy-breadcrumbs{*zoom:1}.wy-breadcrumbs:after,.wy-breadcrumbs:before{display:table;content:""}.wy-breadcrumbs:after{clear:both}.wy-breadcrumbs>li{display:inline-block;padding-top:5px}.wy-breadcrumbs>li.wy-breadcrumbs-aside{float:right}.rst-content .wy-breadcrumbs>li code,.rst-content .wy-breadcrumbs>li tt,.wy-breadcrumbs>li .rst-content tt,.wy-breadcrumbs>li code{all:inherit;color:inherit}.breadcrumb-item:before{content:"/";color:#bbb;font-size:13px;padding:0 6px 0 3px}.wy-breadcrumbs-extra{margin-bottom:0;color:#b3b3b3;font-size:80%;display:inline-block}@media screen and (max-width:480px){.wy-breadcrumbs-extra,.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}@media print{.wy-breadcrumbs li.wy-breadcrumbs-aside{display:none}}html{font-size:16px}.wy-affix{position:fixed;top:1.618em}.wy-menu a:hover{text-decoration:none}.wy-menu-horiz{*zoom:1}.wy-menu-horiz:after,.wy-menu-horiz:before{display:table;content:""}.wy-menu-horiz:after{clear:both}.wy-menu-horiz li,.wy-menu-horiz ul{display:inline-block}.wy-menu-horiz li:hover{background:hsla(0,0%,100%,.1)}.wy-menu-horiz li.divide-left{border-left:1px solid #404040}.wy-menu-horiz li.divide-right{border-right:1px solid #404040}.wy-menu-horiz a{height:32px;display:inline-block;line-height:32px;padding:0 16px}.wy-menu-vertical{width:300px}.wy-menu-vertical header,.wy-menu-vertical p.caption{color:#55a5d9;height:32px;line-height:32px;padding:0 1.618em;margin:12px 0 0;display:block;font-weight:700;text-transform:uppercase;font-size:85%;white-space:nowrap}.wy-menu-vertical ul{margin-bottom:0}.wy-menu-vertical li.divide-top{border-top:1px solid #404040}.wy-menu-vertical li.divide-bottom{border-bottom:1px solid #404040}.wy-menu-vertical li.current{background:#e3e3e3}.wy-menu-vertical li.current a{color:grey;border-right:1px solid #c9c9c9;padding:.4045em 2.427em}.wy-menu-vertical li.current a:hover{background:#d6d6d6}.rst-content .wy-menu-vertical li tt,.wy-menu-vertical li .rst-content tt,.wy-menu-vertical li code{border:none;background:inherit;color:inherit;padding-left:0;padding-right:0}.wy-menu-vertical li button.toctree-expand{display:block;float:left;margin-left:-1.2em;line-height:18px;color:#4d4d4d;border:none;background:none;padding:0}.wy-menu-vertical li.current>a,.wy-menu-vertical li.on a{color:#404040;font-weight:700;position:relative;background:#fcfcfc;border:none;padding:.4045em 1.618em}.wy-menu-vertical li.current>a:hover,.wy-menu-vertical li.on a:hover{background:#fcfcfc}.wy-menu-vertical li.current>a:hover button.toctree-expand,.wy-menu-vertical li.on a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.current>a button.toctree-expand,.wy-menu-vertical li.on a button.toctree-expand{display:block;line-height:18px;color:#333}.wy-menu-vertical li.toctree-l1.current>a{border-bottom:1px solid #c9c9c9;border-top:1px solid #c9c9c9}.wy-menu-vertical .toctree-l1.current .toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .toctree-l11>ul{display:none}.wy-menu-vertical .toctree-l1.current .current.toctree-l2>ul,.wy-menu-vertical .toctree-l2.current .current.toctree-l3>ul,.wy-menu-vertical .toctree-l3.current .current.toctree-l4>ul,.wy-menu-vertical .toctree-l4.current .current.toctree-l5>ul,.wy-menu-vertical .toctree-l5.current .current.toctree-l6>ul,.wy-menu-vertical .toctree-l6.current .current.toctree-l7>ul,.wy-menu-vertical .toctree-l7.current .current.toctree-l8>ul,.wy-menu-vertical .toctree-l8.current .current.toctree-l9>ul,.wy-menu-vertical .toctree-l9.current .current.toctree-l10>ul,.wy-menu-vertical .toctree-l10.current .current.toctree-l11>ul{display:block}.wy-menu-vertical li.toctree-l3,.wy-menu-vertical li.toctree-l4{font-size:.9em}.wy-menu-vertical li.toctree-l2 a,.wy-menu-vertical li.toctree-l3 a,.wy-menu-vertical li.toctree-l4 a,.wy-menu-vertical li.toctree-l5 a,.wy-menu-vertical li.toctree-l6 a,.wy-menu-vertical li.toctree-l7 a,.wy-menu-vertical li.toctree-l8 a,.wy-menu-vertical li.toctree-l9 a,.wy-menu-vertical li.toctree-l10 a{color:#404040}.wy-menu-vertical li.toctree-l2 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l3 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l4 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l5 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l6 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l7 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l8 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l9 a:hover button.toctree-expand,.wy-menu-vertical li.toctree-l10 a:hover button.toctree-expand{color:grey}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a,.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a,.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a,.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a,.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a,.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a,.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a,.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{display:block}.wy-menu-vertical li.toctree-l2.current>a{padding:.4045em 2.427em}.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{padding:.4045em 1.618em .4045em 4.045em}.wy-menu-vertical li.toctree-l3.current>a{padding:.4045em 4.045em}.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{padding:.4045em 1.618em .4045em 5.663em}.wy-menu-vertical li.toctree-l4.current>a{padding:.4045em 5.663em}.wy-menu-vertical li.toctree-l4.current li.toctree-l5>a{padding:.4045em 1.618em .4045em 7.281em}.wy-menu-vertical li.toctree-l5.current>a{padding:.4045em 7.281em}.wy-menu-vertical li.toctree-l5.current li.toctree-l6>a{padding:.4045em 1.618em .4045em 8.899em}.wy-menu-vertical li.toctree-l6.current>a{padding:.4045em 8.899em}.wy-menu-vertical li.toctree-l6.current li.toctree-l7>a{padding:.4045em 1.618em .4045em 10.517em}.wy-menu-vertical li.toctree-l7.current>a{padding:.4045em 10.517em}.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a{padding:.4045em 1.618em .4045em 12.135em}.wy-menu-vertical li.toctree-l8.current>a{padding:.4045em 12.135em}.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a{padding:.4045em 1.618em .4045em 13.753em}.wy-menu-vertical li.toctree-l9.current>a{padding:.4045em 13.753em}.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a{padding:.4045em 1.618em .4045em 15.371em}.wy-menu-vertical li.toctree-l10.current>a{padding:.4045em 15.371em}.wy-menu-vertical li.toctree-l10.current li.toctree-l11>a{padding:.4045em 1.618em .4045em 16.989em}.wy-menu-vertical li.toctree-l2.current>a,.wy-menu-vertical li.toctree-l2.current li.toctree-l3>a{background:#c9c9c9}.wy-menu-vertical li.toctree-l2 button.toctree-expand{color:#a3a3a3}.wy-menu-vertical li.toctree-l3.current>a,.wy-menu-vertical li.toctree-l3.current li.toctree-l4>a{background:#bdbdbd}.wy-menu-vertical li.toctree-l3 button.toctree-expand{color:#969696}.wy-menu-vertical li.current ul{display:block}.wy-menu-vertical li ul{margin-bottom:0;display:none}.wy-menu-vertical li ul li a{margin-bottom:0;color:#d9d9d9;font-weight:400}.wy-menu-vertical a{line-height:18px;padding:.4045em 1.618em;display:block;position:relative;font-size:90%;color:#d9d9d9}.wy-menu-vertical a:hover{background-color:#4e4a4a;cursor:pointer}.wy-menu-vertical a:hover button.toctree-expand{color:#d9d9d9}.wy-menu-vertical a:active{background-color:#2980b9;cursor:pointer;color:#fff}.wy-menu-vertical a:active button.toctree-expand{color:#fff}.wy-side-nav-search{display:block;width:300px;padding:.809em;margin-bottom:.809em;z-index:200;background-color:#2980b9;text-align:center;color:#fcfcfc}.wy-side-nav-search input[type=text]{width:100%;border-radius:50px;padding:6px 12px;border-color:#2472a4}.wy-side-nav-search img{display:block;margin:auto auto .809em;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-side-nav-search .wy-dropdown>a,.wy-side-nav-search>a{color:#fcfcfc;font-size:100%;font-weight:700;display:inline-block;padding:4px 6px;margin-bottom:.809em;max-width:100%}.wy-side-nav-search .wy-dropdown>a:hover,.wy-side-nav-search>a:hover{background:hsla(0,0%,100%,.1)}.wy-side-nav-search .wy-dropdown>a img.logo,.wy-side-nav-search>a img.logo{display:block;margin:0 auto;height:auto;width:auto;border-radius:0;max-width:100%;background:transparent}.wy-side-nav-search .wy-dropdown>a.icon img.logo,.wy-side-nav-search>a.icon img.logo{margin-top:.85em}.wy-side-nav-search>div.version{margin-top:-.4045em;margin-bottom:.809em;font-weight:400;color:hsla(0,0%,100%,.3)}.wy-nav .wy-menu-vertical header{color:#2980b9}.wy-nav .wy-menu-vertical a{color:#b3b3b3}.wy-nav .wy-menu-vertical a:hover{background-color:#2980b9;color:#fff}[data-menu-wrap]{-webkit-transition:all .2s ease-in;-moz-transition:all .2s ease-in;transition:all .2s ease-in;position:absolute;opacity:1;width:100%;opacity:0}[data-menu-wrap].move-center{left:0;right:auto;opacity:1}[data-menu-wrap].move-left{right:auto;left:-100%;opacity:0}[data-menu-wrap].move-right{right:-100%;left:auto;opacity:0}.wy-body-for-nav{background:#fcfcfc}.wy-grid-for-nav{position:absolute;width:100%;height:100%}.wy-nav-side{position:fixed;top:0;bottom:0;left:0;padding-bottom:2em;width:300px;overflow-x:hidden;overflow-y:hidden;min-height:100%;color:#9b9b9b;background:#343131;z-index:200}.wy-side-scroll{width:320px;position:relative;overflow-x:hidden;overflow-y:scroll;height:100%}.wy-nav-top{display:none;background:#2980b9;color:#fff;padding:.4045em .809em;position:relative;line-height:50px;text-align:center;font-size:100%;*zoom:1}.wy-nav-top:after,.wy-nav-top:before{display:table;content:""}.wy-nav-top:after{clear:both}.wy-nav-top a{color:#fff;font-weight:700}.wy-nav-top img{margin-right:12px;height:45px;width:45px;background-color:#2980b9;padding:5px;border-radius:100%}.wy-nav-top i{font-size:30px;float:left;cursor:pointer;padding-top:inherit}.wy-nav-content-wrap{margin-left:300px;background:#fcfcfc;min-height:100%}.wy-nav-content{padding:1.618em 3.236em;height:100%;max-width:800px;margin:auto}.wy-body-mask{position:fixed;width:100%;height:100%;background:rgba(0,0,0,.2);display:none;z-index:499}.wy-body-mask.on{display:block}footer{color:grey}footer p{margin-bottom:12px}.rst-content footer span.commit tt,footer span.commit .rst-content tt,footer span.commit code{padding:0;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:1em;background:none;border:none;color:grey}.rst-footer-buttons{*zoom:1}.rst-footer-buttons:after,.rst-footer-buttons:before{width:100%;display:table;content:""}.rst-footer-buttons:after{clear:both}.rst-breadcrumbs-buttons{margin-top:12px;*zoom:1}.rst-breadcrumbs-buttons:after,.rst-breadcrumbs-buttons:before{display:table;content:""}.rst-breadcrumbs-buttons:after{clear:both}#search-results .search li{margin-bottom:24px;border-bottom:1px solid #e1e4e5;padding-bottom:24px}#search-results .search li:first-child{border-top:1px solid #e1e4e5;padding-top:24px}#search-results .search li a{font-size:120%;margin-bottom:12px;display:inline-block}#search-results .context{color:grey;font-size:90%}.genindextable li>ul{margin-left:24px}@media screen and (max-width:768px){.wy-body-for-nav{background:#fcfcfc}.wy-nav-top{display:block}.wy-nav-side{left:-300px}.wy-nav-side.shift{width:85%;left:0}.wy-menu.wy-menu-vertical,.wy-side-nav-search,.wy-side-scroll{width:auto}.wy-nav-content-wrap{margin-left:0}.wy-nav-content-wrap .wy-nav-content{padding:1.618em}.wy-nav-content-wrap.shift{position:fixed;min-width:100%;left:85%;top:0;height:100%;overflow:hidden}}@media screen and (min-width:1100px){.wy-nav-content-wrap{background:rgba(0,0,0,.05)}.wy-nav-content{margin:0;background:#fcfcfc}}@media print{.rst-versions,.wy-nav-side,footer{display:none}.wy-nav-content-wrap{margin-left:0}}.rst-versions{position:fixed;bottom:0;left:0;width:300px;color:#fcfcfc;background:#1f1d1d;font-family:Lato,proxima-nova,Helvetica Neue,Arial,sans-serif;z-index:400}.rst-versions a{color:#2980b9;text-decoration:none}.rst-versions .rst-badge-small{display:none}.rst-versions .rst-current-version{padding:12px;background-color:#272525;display:block;text-align:right;font-size:90%;cursor:pointer;color:#27ae60;*zoom:1}.rst-versions .rst-current-version:after,.rst-versions .rst-current-version:before{display:table;content:""}.rst-versions .rst-current-version:after{clear:both}.rst-content .code-block-caption .rst-versions .rst-current-version .headerlink,.rst-content .eqno .rst-versions .rst-current-version .headerlink,.rst-content .rst-versions .rst-current-version .admonition-title,.rst-content code.download .rst-versions .rst-current-version span:first-child,.rst-content dl dt .rst-versions .rst-current-version .headerlink,.rst-content h1 .rst-versions .rst-current-version .headerlink,.rst-content h2 .rst-versions .rst-current-version .headerlink,.rst-content h3 .rst-versions .rst-current-version .headerlink,.rst-content h4 .rst-versions .rst-current-version .headerlink,.rst-content h5 .rst-versions .rst-current-version .headerlink,.rst-content h6 .rst-versions .rst-current-version .headerlink,.rst-content p .rst-versions .rst-current-version .headerlink,.rst-content table>caption .rst-versions .rst-current-version .headerlink,.rst-content tt.download .rst-versions .rst-current-version span:first-child,.rst-versions .rst-current-version .fa,.rst-versions .rst-current-version .icon,.rst-versions .rst-current-version .rst-content .admonition-title,.rst-versions .rst-current-version .rst-content .code-block-caption .headerlink,.rst-versions .rst-current-version .rst-content .eqno .headerlink,.rst-versions .rst-current-version .rst-content code.download span:first-child,.rst-versions .rst-current-version .rst-content dl dt .headerlink,.rst-versions .rst-current-version .rst-content h1 .headerlink,.rst-versions .rst-current-version .rst-content h2 .headerlink,.rst-versions .rst-current-version .rst-content h3 .headerlink,.rst-versions .rst-current-version .rst-content h4 .headerlink,.rst-versions .rst-current-version .rst-content h5 .headerlink,.rst-versions .rst-current-version .rst-content h6 .headerlink,.rst-versions .rst-current-version .rst-content p .headerlink,.rst-versions .rst-current-version .rst-content table>caption .headerlink,.rst-versions .rst-current-version .rst-content tt.download span:first-child,.rst-versions .rst-current-version .wy-menu-vertical li button.toctree-expand,.wy-menu-vertical li .rst-versions .rst-current-version button.toctree-expand{color:#fcfcfc}.rst-versions .rst-current-version .fa-book,.rst-versions .rst-current-version .icon-book{float:left}.rst-versions .rst-current-version.rst-out-of-date{background-color:#e74c3c;color:#fff}.rst-versions .rst-current-version.rst-active-old-version{background-color:#f1c40f;color:#000}.rst-versions.shift-up{height:auto;max-height:100%;overflow-y:scroll}.rst-versions.shift-up .rst-other-versions{display:block}.rst-versions .rst-other-versions{font-size:90%;padding:12px;color:grey;display:none}.rst-versions .rst-other-versions hr{display:block;height:1px;border:0;margin:20px 0;padding:0;border-top:1px solid #413d3d}.rst-versions .rst-other-versions dd{display:inline-block;margin:0}.rst-versions .rst-other-versions dd a{display:inline-block;padding:6px;color:#fcfcfc}.rst-versions.rst-badge{width:auto;bottom:20px;right:20px;left:auto;border:none;max-width:300px;max-height:90%}.rst-versions.rst-badge .fa-book,.rst-versions.rst-badge .icon-book{float:none;line-height:30px}.rst-versions.rst-badge.shift-up .rst-current-version{text-align:right}.rst-versions.rst-badge.shift-up .rst-current-version .fa-book,.rst-versions.rst-badge.shift-up .rst-current-version .icon-book{float:left}.rst-versions.rst-badge>.rst-current-version{width:auto;height:30px;line-height:30px;padding:0 6px;display:block;text-align:center}@media screen and (max-width:768px){.rst-versions{width:85%;display:none}.rst-versions.shift{display:block}}.rst-content .toctree-wrapper>p.caption,.rst-content h1,.rst-content h2,.rst-content h3,.rst-content h4,.rst-content h5,.rst-content h6{margin-bottom:24px}.rst-content img{max-width:100%;height:auto}.rst-content div.figure,.rst-content figure{margin-bottom:24px}.rst-content div.figure .caption-text,.rst-content figure .caption-text{font-style:italic}.rst-content div.figure p:last-child.caption,.rst-content figure p:last-child.caption{margin-bottom:0}.rst-content div.figure.align-center,.rst-content figure.align-center{text-align:center}.rst-content .section>a>img,.rst-content .section>img,.rst-content section>a>img,.rst-content section>img{margin-bottom:24px}.rst-content abbr[title]{text-decoration:none}.rst-content.style-external-links a.reference.external:after{font-family:FontAwesome;content:"\f08e";color:#b3b3b3;vertical-align:super;font-size:60%;margin:0 .2em}.rst-content blockquote{margin-left:24px;line-height:24px;margin-bottom:24px}.rst-content pre.literal-block{white-space:pre;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;display:block;overflow:auto}.rst-content div[class^=highlight],.rst-content pre.literal-block{border:1px solid #e1e4e5;overflow-x:auto;margin:1px 0 24px}.rst-content div[class^=highlight] div[class^=highlight],.rst-content pre.literal-block div[class^=highlight]{padding:0;border:none;margin:0}.rst-content div[class^=highlight] td.code{width:100%}.rst-content .linenodiv pre{border-right:1px solid #e6e9ea;margin:0;padding:12px;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;user-select:none;pointer-events:none}.rst-content div[class^=highlight] pre{white-space:pre;margin:0;padding:12px;display:block;overflow:auto}.rst-content div[class^=highlight] pre .hll{display:block;margin:0 -12px;padding:0 12px}.rst-content .linenodiv pre,.rst-content div[class^=highlight] pre,.rst-content pre.literal-block{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;font-size:12px;line-height:1.4}.rst-content div.highlight .gp,.rst-content div.highlight span.linenos{user-select:none;pointer-events:none}.rst-content div.highlight span.linenos{display:inline-block;padding-left:0;padding-right:12px;margin-right:12px;border-right:1px solid #e6e9ea}.rst-content .code-block-caption{font-style:italic;font-size:85%;line-height:1;padding:1em 0;text-align:center}@media print{.rst-content .codeblock,.rst-content div[class^=highlight],.rst-content div[class^=highlight] pre{white-space:pre-wrap}}.rst-content .admonition,.rst-content .admonition-todo,.rst-content .attention,.rst-content .caution,.rst-content .danger,.rst-content .error,.rst-content .hint,.rst-content .important,.rst-content .note,.rst-content .seealso,.rst-content .tip,.rst-content .warning{clear:both}.rst-content .admonition-todo .last,.rst-content .admonition-todo>:last-child,.rst-content .admonition .last,.rst-content .admonition>:last-child,.rst-content .attention .last,.rst-content .attention>:last-child,.rst-content .caution .last,.rst-content .caution>:last-child,.rst-content .danger .last,.rst-content .danger>:last-child,.rst-content .error .last,.rst-content .error>:last-child,.rst-content .hint .last,.rst-content .hint>:last-child,.rst-content .important .last,.rst-content .important>:last-child,.rst-content .note .last,.rst-content .note>:last-child,.rst-content .seealso .last,.rst-content .seealso>:last-child,.rst-content .tip .last,.rst-content .tip>:last-child,.rst-content .warning .last,.rst-content .warning>:last-child{margin-bottom:0}.rst-content .admonition-title:before{margin-right:4px}.rst-content .admonition table{border-color:rgba(0,0,0,.1)}.rst-content .admonition table td,.rst-content .admonition table th{background:transparent!important;border-color:rgba(0,0,0,.1)!important}.rst-content .section ol.loweralpha,.rst-content .section ol.loweralpha>li,.rst-content .toctree-wrapper ol.loweralpha,.rst-content .toctree-wrapper ol.loweralpha>li,.rst-content section ol.loweralpha,.rst-content section ol.loweralpha>li{list-style:lower-alpha}.rst-content .section ol.upperalpha,.rst-content .section ol.upperalpha>li,.rst-content .toctree-wrapper ol.upperalpha,.rst-content .toctree-wrapper ol.upperalpha>li,.rst-content section ol.upperalpha,.rst-content section ol.upperalpha>li{list-style:upper-alpha}.rst-content .section ol li>*,.rst-content .section ul li>*,.rst-content .toctree-wrapper ol li>*,.rst-content .toctree-wrapper ul li>*,.rst-content section ol li>*,.rst-content section ul li>*{margin-top:12px;margin-bottom:12px}.rst-content .section ol li>:first-child,.rst-content .section ul li>:first-child,.rst-content .toctree-wrapper ol li>:first-child,.rst-content .toctree-wrapper ul li>:first-child,.rst-content section ol li>:first-child,.rst-content section ul li>:first-child{margin-top:0}.rst-content .section ol li>p,.rst-content .section ol li>p:last-child,.rst-content .section ul li>p,.rst-content .section ul li>p:last-child,.rst-content .toctree-wrapper ol li>p,.rst-content .toctree-wrapper ol li>p:last-child,.rst-content .toctree-wrapper ul li>p,.rst-content .toctree-wrapper ul li>p:last-child,.rst-content section ol li>p,.rst-content section ol li>p:last-child,.rst-content section ul li>p,.rst-content section ul li>p:last-child{margin-bottom:12px}.rst-content .section ol li>p:only-child,.rst-content .section ol li>p:only-child:last-child,.rst-content .section ul li>p:only-child,.rst-content .section ul li>p:only-child:last-child,.rst-content .toctree-wrapper ol li>p:only-child,.rst-content .toctree-wrapper ol li>p:only-child:last-child,.rst-content .toctree-wrapper ul li>p:only-child,.rst-content .toctree-wrapper ul li>p:only-child:last-child,.rst-content section ol li>p:only-child,.rst-content section ol li>p:only-child:last-child,.rst-content section ul li>p:only-child,.rst-content section ul li>p:only-child:last-child{margin-bottom:0}.rst-content .section ol li>ol,.rst-content .section ol li>ul,.rst-content .section ul li>ol,.rst-content .section ul li>ul,.rst-content .toctree-wrapper ol li>ol,.rst-content .toctree-wrapper ol li>ul,.rst-content .toctree-wrapper ul li>ol,.rst-content .toctree-wrapper ul li>ul,.rst-content section ol li>ol,.rst-content section ol li>ul,.rst-content section ul li>ol,.rst-content section ul li>ul{margin-bottom:12px}.rst-content .section ol.simple li>*,.rst-content .section ol.simple li ol,.rst-content .section ol.simple li ul,.rst-content .section ul.simple li>*,.rst-content .section ul.simple li ol,.rst-content .section ul.simple li ul,.rst-content .toctree-wrapper ol.simple li>*,.rst-content .toctree-wrapper ol.simple li ol,.rst-content .toctree-wrapper ol.simple li ul,.rst-content .toctree-wrapper ul.simple li>*,.rst-content .toctree-wrapper ul.simple li ol,.rst-content .toctree-wrapper ul.simple li ul,.rst-content section ol.simple li>*,.rst-content section ol.simple li ol,.rst-content section ol.simple li ul,.rst-content section ul.simple li>*,.rst-content section ul.simple li ol,.rst-content section ul.simple li ul{margin-top:0;margin-bottom:0}.rst-content .line-block{margin-left:0;margin-bottom:24px;line-height:24px}.rst-content .line-block .line-block{margin-left:24px;margin-bottom:0}.rst-content .topic-title{font-weight:700;margin-bottom:12px}.rst-content .toc-backref{color:#404040}.rst-content .align-right{float:right;margin:0 0 24px 24px}.rst-content .align-left{float:left;margin:0 24px 24px 0}.rst-content .align-center{margin:auto}.rst-content .align-center:not(table){display:block}.rst-content .code-block-caption .headerlink,.rst-content .eqno .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink,.rst-content dl dt .headerlink,.rst-content h1 .headerlink,.rst-content h2 .headerlink,.rst-content h3 .headerlink,.rst-content h4 .headerlink,.rst-content h5 .headerlink,.rst-content h6 .headerlink,.rst-content p.caption .headerlink,.rst-content p .headerlink,.rst-content table>caption .headerlink{opacity:0;font-size:14px;font-family:FontAwesome;margin-left:.5em}.rst-content .code-block-caption .headerlink:focus,.rst-content .code-block-caption:hover .headerlink,.rst-content .eqno .headerlink:focus,.rst-content .eqno:hover .headerlink,.rst-content .toctree-wrapper>p.caption .headerlink:focus,.rst-content .toctree-wrapper>p.caption:hover .headerlink,.rst-content dl dt .headerlink:focus,.rst-content dl dt:hover .headerlink,.rst-content h1 .headerlink:focus,.rst-content h1:hover .headerlink,.rst-content h2 .headerlink:focus,.rst-content h2:hover .headerlink,.rst-content h3 .headerlink:focus,.rst-content h3:hover .headerlink,.rst-content h4 .headerlink:focus,.rst-content h4:hover .headerlink,.rst-content h5 .headerlink:focus,.rst-content h5:hover .headerlink,.rst-content h6 .headerlink:focus,.rst-content h6:hover .headerlink,.rst-content p.caption .headerlink:focus,.rst-content p.caption:hover .headerlink,.rst-content p .headerlink:focus,.rst-content p:hover .headerlink,.rst-content table>caption .headerlink:focus,.rst-content table>caption:hover .headerlink{opacity:1}.rst-content p a{overflow-wrap:anywhere}.rst-content .wy-table td p,.rst-content .wy-table td ul,.rst-content .wy-table th p,.rst-content .wy-table th ul,.rst-content table.docutils td p,.rst-content table.docutils td ul,.rst-content table.docutils th p,.rst-content table.docutils th ul,.rst-content table.field-list td p,.rst-content table.field-list td ul,.rst-content table.field-list th p,.rst-content table.field-list th ul{font-size:inherit}.rst-content .btn:focus{outline:2px solid}.rst-content table>caption .headerlink:after{font-size:12px}.rst-content .centered{text-align:center}.rst-content .sidebar{float:right;width:40%;display:block;margin:0 0 24px 24px;padding:24px;background:#f3f6f6;border:1px solid #e1e4e5}.rst-content .sidebar dl,.rst-content .sidebar p,.rst-content .sidebar ul{font-size:90%}.rst-content .sidebar .last,.rst-content .sidebar>:last-child{margin-bottom:0}.rst-content .sidebar .sidebar-title{display:block;font-family:Roboto Slab,ff-tisa-web-pro,Georgia,Arial,sans-serif;font-weight:700;background:#e1e4e5;padding:6px 12px;margin:-24px -24px 24px;font-size:100%}.rst-content .highlighted{background:#f1c40f;box-shadow:0 0 0 2px #f1c40f;display:inline;font-weight:700}.rst-content .citation-reference,.rst-content .footnote-reference{vertical-align:baseline;position:relative;top:-.4em;line-height:0;font-size:90%}.rst-content .citation-reference>span.fn-bracket,.rst-content .footnote-reference>span.fn-bracket{display:none}.rst-content .hlist{width:100%}.rst-content dl dt span.classifier:before{content:" : "}.rst-content dl dt span.classifier-delimiter{display:none!important}html.writer-html4 .rst-content table.docutils.citation,html.writer-html4 .rst-content table.docutils.footnote{background:none;border:none}html.writer-html4 .rst-content table.docutils.citation td,html.writer-html4 .rst-content table.docutils.citation tr,html.writer-html4 .rst-content table.docutils.footnote td,html.writer-html4 .rst-content table.docutils.footnote tr{border:none;background-color:transparent!important;white-space:normal}html.writer-html4 .rst-content table.docutils.citation td.label,html.writer-html4 .rst-content table.docutils.footnote td.label{padding-left:0;padding-right:0;vertical-align:top}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{display:grid;grid-template-columns:auto minmax(80%,95%)}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{display:inline-grid;grid-template-columns:max-content auto}html.writer-html5 .rst-content aside.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content div.citation{display:grid;grid-template-columns:auto auto minmax(.65rem,auto) minmax(40%,95%)}html.writer-html5 .rst-content aside.citation>span.label,html.writer-html5 .rst-content aside.footnote>span.label,html.writer-html5 .rst-content div.citation>span.label{grid-column-start:1;grid-column-end:2}html.writer-html5 .rst-content aside.citation>span.backrefs,html.writer-html5 .rst-content aside.footnote>span.backrefs,html.writer-html5 .rst-content div.citation>span.backrefs{grid-column-start:2;grid-column-end:3;grid-row-start:1;grid-row-end:3}html.writer-html5 .rst-content aside.citation>p,html.writer-html5 .rst-content aside.footnote>p,html.writer-html5 .rst-content div.citation>p{grid-column-start:4;grid-column-end:5}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.field-list,html.writer-html5 .rst-content dl.footnote{margin-bottom:24px}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dt{padding-left:1rem}html.writer-html5 .rst-content dl.citation>dd,html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.field-list>dd,html.writer-html5 .rst-content dl.field-list>dt,html.writer-html5 .rst-content dl.footnote>dd,html.writer-html5 .rst-content dl.footnote>dt{margin-bottom:0}html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.footnote{font-size:.9rem}html.writer-html5 .rst-content dl.citation>dt,html.writer-html5 .rst-content dl.footnote>dt{margin:0 .5rem .5rem 0;line-height:1.2rem;word-break:break-all;font-weight:400}html.writer-html5 .rst-content dl.citation>dt>span.brackets:before,html.writer-html5 .rst-content dl.footnote>dt>span.brackets:before{content:"["}html.writer-html5 .rst-content dl.citation>dt>span.brackets:after,html.writer-html5 .rst-content dl.footnote>dt>span.brackets:after{content:"]"}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref{text-align:left;font-style:italic;margin-left:.65rem;word-break:break-word;word-spacing:-.1rem;max-width:5rem}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref>a,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref>a{word-break:keep-all}html.writer-html5 .rst-content dl.citation>dt>span.fn-backref>a:not(:first-child):before,html.writer-html5 .rst-content dl.footnote>dt>span.fn-backref>a:not(:first-child):before{content:" "}html.writer-html5 .rst-content dl.citation>dd,html.writer-html5 .rst-content dl.footnote>dd{margin:0 0 .5rem;line-height:1.2rem}html.writer-html5 .rst-content dl.citation>dd p,html.writer-html5 .rst-content dl.footnote>dd p{font-size:.9rem}html.writer-html5 .rst-content aside.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content div.citation{padding-left:1rem;padding-right:1rem;font-size:.9rem;line-height:1.2rem}html.writer-html5 .rst-content aside.citation p,html.writer-html5 .rst-content aside.footnote p,html.writer-html5 .rst-content div.citation p{font-size:.9rem;line-height:1.2rem;margin-bottom:12px}html.writer-html5 .rst-content aside.citation span.backrefs,html.writer-html5 .rst-content aside.footnote span.backrefs,html.writer-html5 .rst-content div.citation span.backrefs{text-align:left;font-style:italic;margin-left:.65rem;word-break:break-word;word-spacing:-.1rem;max-width:5rem}html.writer-html5 .rst-content aside.citation span.backrefs>a,html.writer-html5 .rst-content aside.footnote span.backrefs>a,html.writer-html5 .rst-content div.citation span.backrefs>a{word-break:keep-all}html.writer-html5 .rst-content aside.citation span.backrefs>a:not(:first-child):before,html.writer-html5 .rst-content aside.footnote span.backrefs>a:not(:first-child):before,html.writer-html5 .rst-content div.citation span.backrefs>a:not(:first-child):before{content:" "}html.writer-html5 .rst-content aside.citation span.label,html.writer-html5 .rst-content aside.footnote span.label,html.writer-html5 .rst-content div.citation span.label{line-height:1.2rem}html.writer-html5 .rst-content aside.citation-list,html.writer-html5 .rst-content aside.footnote-list,html.writer-html5 .rst-content div.citation-list{margin-bottom:24px}html.writer-html5 .rst-content dl.option-list kbd{font-size:.9rem}.rst-content table.docutils.footnote,html.writer-html4 .rst-content table.docutils.citation,html.writer-html5 .rst-content aside.footnote,html.writer-html5 .rst-content aside.footnote-list aside.footnote,html.writer-html5 .rst-content div.citation-list>div.citation,html.writer-html5 .rst-content dl.citation,html.writer-html5 .rst-content dl.footnote{color:grey}.rst-content table.docutils.footnote code,.rst-content table.docutils.footnote tt,html.writer-html4 .rst-content table.docutils.citation code,html.writer-html4 .rst-content table.docutils.citation tt,html.writer-html5 .rst-content aside.footnote-list aside.footnote code,html.writer-html5 .rst-content aside.footnote-list aside.footnote tt,html.writer-html5 .rst-content aside.footnote code,html.writer-html5 .rst-content aside.footnote tt,html.writer-html5 .rst-content div.citation-list>div.citation code,html.writer-html5 .rst-content div.citation-list>div.citation tt,html.writer-html5 .rst-content dl.citation code,html.writer-html5 .rst-content dl.citation tt,html.writer-html5 .rst-content dl.footnote code,html.writer-html5 .rst-content dl.footnote tt{color:#555}.rst-content .wy-table-responsive.citation,.rst-content .wy-table-responsive.footnote{margin-bottom:0}.rst-content .wy-table-responsive.citation+:not(.citation),.rst-content .wy-table-responsive.footnote+:not(.footnote){margin-top:24px}.rst-content .wy-table-responsive.citation:last-child,.rst-content .wy-table-responsive.footnote:last-child{margin-bottom:24px}.rst-content table.docutils th{border-color:#e1e4e5}html.writer-html5 .rst-content table.docutils th{border:1px solid #e1e4e5}html.writer-html5 .rst-content table.docutils td>p,html.writer-html5 .rst-content table.docutils th>p{line-height:1rem;margin-bottom:0;font-size:.9rem}.rst-content table.docutils td .last,.rst-content table.docutils td .last>:last-child{margin-bottom:0}.rst-content table.field-list,.rst-content table.field-list td{border:none}.rst-content table.field-list td p{line-height:inherit}.rst-content table.field-list td>strong{display:inline-block}.rst-content table.field-list .field-name{padding-right:10px;text-align:left;white-space:nowrap}.rst-content table.field-list .field-body{text-align:left}.rst-content code,.rst-content tt{color:#000;font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;padding:2px 5px}.rst-content code big,.rst-content code em,.rst-content tt big,.rst-content tt em{font-size:100%!important;line-height:normal}.rst-content code.literal,.rst-content tt.literal{color:#e74c3c;white-space:normal}.rst-content code.xref,.rst-content tt.xref,a .rst-content code,a .rst-content tt{font-weight:700;color:#404040;overflow-wrap:normal}.rst-content kbd,.rst-content pre,.rst-content samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace}.rst-content a code,.rst-content a tt{color:#2980b9}.rst-content dl{margin-bottom:24px}.rst-content dl dt{font-weight:700;margin-bottom:12px}.rst-content dl ol,.rst-content dl p,.rst-content dl table,.rst-content dl ul{margin-bottom:12px}.rst-content dl dd{margin:0 0 12px 24px;line-height:24px}.rst-content dl dd>ol:last-child,.rst-content dl dd>p:last-child,.rst-content dl dd>table:last-child,.rst-content dl dd>ul:last-child{margin-bottom:0}html.writer-html4 .rst-content dl:not(.docutils),html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple){margin-bottom:24px}html.writer-html4 .rst-content dl:not(.docutils)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt{display:table;margin:6px 0;font-size:90%;line-height:normal;background:#e7f2fa;color:#2980b9;border-top:3px solid #6ab0de;padding:6px;position:relative}html.writer-html4 .rst-content dl:not(.docutils)>dt:before,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt:before{color:#6ab0de}html.writer-html4 .rst-content dl:not(.docutils)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt{margin-bottom:6px;border:none;border-left:3px solid #ccc;background:#f0f0f0;color:#555}html.writer-html4 .rst-content dl:not(.docutils) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) dl:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt .headerlink{color:#404040;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils)>dt:first-child,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple)>dt:first-child{margin-top:0}html.writer-html4 .rst-content dl:not(.docutils) code.descclassname,html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descclassname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descname{background-color:transparent;border:none;padding:0;font-size:100%!important}html.writer-html4 .rst-content dl:not(.docutils) code.descname,html.writer-html4 .rst-content dl:not(.docutils) tt.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) code.descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) tt.descname{font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .optional,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .optional{display:inline-block;padding:0 4px;color:#000;font-weight:700}html.writer-html4 .rst-content dl:not(.docutils) .property,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .property{display:inline-block;padding-right:8px;max-width:100%}html.writer-html4 .rst-content dl:not(.docutils) .k,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .k{font-style:italic}html.writer-html4 .rst-content dl:not(.docutils) .descclassname,html.writer-html4 .rst-content dl:not(.docutils) .descname,html.writer-html4 .rst-content dl:not(.docutils) .sig-name,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .descclassname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .descname,html.writer-html5 .rst-content dl[class]:not(.option-list):not(.field-list):not(.footnote):not(.citation):not(.glossary):not(.simple) .sig-name{font-family:SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,Courier,monospace;color:#000}.rst-content .viewcode-back,.rst-content .viewcode-link{display:inline-block;color:#27ae60;font-size:80%;padding-left:24px}.rst-content .viewcode-back{display:block;float:right}.rst-content p.rubric{margin-bottom:12px;font-weight:700}.rst-content code.download,.rst-content tt.download{background:inherit;padding:inherit;font-weight:400;font-family:inherit;font-size:inherit;color:inherit;border:inherit;white-space:inherit}.rst-content code.download span:first-child,.rst-content tt.download span:first-child{-webkit-font-smoothing:subpixel-antialiased}.rst-content code.download span:first-child:before,.rst-content tt.download span:first-child:before{margin-right:4px}.rst-content .guilabel,.rst-content .menuselection{font-size:80%;font-weight:700;border-radius:4px;padding:2.4px 6px;margin:auto 2px}.rst-content .guilabel,.rst-content .menuselection{border:1px solid #7fbbe3;background:#e7f2fa}.rst-content :not(dl.option-list)>:not(dt):not(kbd):not(.kbd)>.kbd,.rst-content :not(dl.option-list)>:not(dt):not(kbd):not(.kbd)>kbd{color:inherit;font-size:80%;background-color:#fff;border:1px solid #a6a6a6;border-radius:4px;box-shadow:0 2px grey;padding:2.4px 6px;margin:auto 0}.rst-content .versionmodified{font-style:italic}@media screen and (max-width:480px){.rst-content .sidebar{width:100%}}span[id*=MathJax-Span]{color:#404040}.math{text-align:center}@font-face{font-family:Lato;src:url(fonts/lato-normal.woff2?bd03a2cc277bbbc338d464e679fe9942) format("woff2"),url(fonts/lato-normal.woff?27bd77b9162d388cb8d4c4217c7c5e2a) format("woff");font-weight:400;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold.woff2?cccb897485813c7c256901dbca54ecf2) format("woff2"),url(fonts/lato-bold.woff?d878b6c29b10beca227e9eef4246111b) format("woff");font-weight:700;font-style:normal;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-bold-italic.woff2?0b6bb6725576b072c5d0b02ecdd1900d) format("woff2"),url(fonts/lato-bold-italic.woff?9c7e4e9eb485b4a121c760e61bc3707c) format("woff");font-weight:700;font-style:italic;font-display:block}@font-face{font-family:Lato;src:url(fonts/lato-normal-italic.woff2?4eb103b4d12be57cb1d040ed5e162e9d) format("woff2"),url(fonts/lato-normal-italic.woff?f28f2d6482446544ef1ea1ccc6dd5892) format("woff");font-weight:400;font-style:italic;font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:400;src:url(fonts/Roboto-Slab-Regular.woff2?7abf5b8d04d26a2cafea937019bca958) format("woff2"),url(fonts/Roboto-Slab-Regular.woff?c1be9284088d487c5e3ff0a10a92e58c) format("woff");font-display:block}@font-face{font-family:Roboto Slab;font-style:normal;font-weight:700;src:url(fonts/Roboto-Slab-Bold.woff2?9984f4a9bda09be08e83f2506954adbe) format("woff2"),url(fonts/Roboto-Slab-Bold.woff?bed5564a116b05148e3b3bea6fb1162a) format("woff");font-display:block} \ No newline at end of file diff --git a/_static/doctools.js b/_static/doctools.js new file mode 100644 index 0000000..d06a71d --- /dev/null +++ b/_static/doctools.js @@ -0,0 +1,156 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Base JavaScript utilities for all Sphinx HTML documentation. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ + "TEXTAREA", + "INPUT", + "SELECT", + "BUTTON", +]); + +const _ready = (callback) => { + if (document.readyState !== "loading") { + callback(); + } else { + document.addEventListener("DOMContentLoaded", callback); + } +}; + +/** + * Small JavaScript module for the documentation. + */ +const Documentation = { + init: () => { + Documentation.initDomainIndexTable(); + Documentation.initOnKeyListeners(); + }, + + /** + * i18n support + */ + TRANSLATIONS: {}, + PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), + LOCALE: "unknown", + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext: (string) => { + const translated = Documentation.TRANSLATIONS[string]; + switch (typeof translated) { + case "undefined": + return string; // no translation + case "string": + return translated; // translation exists + default: + return translated[0]; // (singular, plural) translation tuple exists + } + }, + + ngettext: (singular, plural, n) => { + const translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated !== "undefined") + return translated[Documentation.PLURAL_EXPR(n)]; + return n === 1 ? singular : plural; + }, + + addTranslations: (catalog) => { + Object.assign(Documentation.TRANSLATIONS, catalog.messages); + Documentation.PLURAL_EXPR = new Function( + "n", + `return (${catalog.plural_expr})` + ); + Documentation.LOCALE = catalog.locale; + }, + + /** + * helper function to focus on search bar + */ + focusSearchBar: () => { + document.querySelectorAll("input[name=q]")[0]?.focus(); + }, + + /** + * Initialise the domain index toggle buttons + */ + initDomainIndexTable: () => { + const toggler = (el) => { + const idNumber = el.id.substr(7); + const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); + if (el.src.substr(-9) === "minus.png") { + el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; + toggledRows.forEach((el) => (el.style.display = "none")); + } else { + el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; + toggledRows.forEach((el) => (el.style.display = "")); + } + }; + + const togglerElements = document.querySelectorAll("img.toggler"); + togglerElements.forEach((el) => + el.addEventListener("click", (event) => toggler(event.currentTarget)) + ); + togglerElements.forEach((el) => (el.style.display = "")); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); + }, + + initOnKeyListeners: () => { + // only install a listener if it is really needed + if ( + !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS && + !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + ) + return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.altKey || event.ctrlKey || event.metaKey) return; + + if (!event.shiftKey) { + switch (event.key) { + case "ArrowLeft": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const prevLink = document.querySelector('link[rel="prev"]'); + if (prevLink && prevLink.href) { + window.location.href = prevLink.href; + event.preventDefault(); + } + break; + case "ArrowRight": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const nextLink = document.querySelector('link[rel="next"]'); + if (nextLink && nextLink.href) { + window.location.href = nextLink.href; + event.preventDefault(); + } + break; + } + } + + // some keyboard layouts may need Shift to get / + switch (event.key) { + case "/": + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; + Documentation.focusSearchBar(); + event.preventDefault(); + } + }); + }, +}; + +// quick alias for translations +const _ = Documentation.gettext; + +_ready(Documentation.init); diff --git a/_static/documentation_options.js b/_static/documentation_options.js new file mode 100644 index 0000000..6b78aad --- /dev/null +++ b/_static/documentation_options.js @@ -0,0 +1,13 @@ +const DOCUMENTATION_OPTIONS = { + VERSION: '01.00.00', + LANGUAGE: 'en', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: false, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, +}; \ No newline at end of file diff --git a/_static/file.png b/_static/file.png new file mode 100644 index 0000000..a858a41 Binary files /dev/null and b/_static/file.png differ diff --git a/_static/google_places_strategy.drawio.png b/_static/google_places_strategy.drawio.png new file mode 100644 index 0000000..cc6bf22 Binary files /dev/null and b/_static/google_places_strategy.drawio.png differ diff --git a/_static/google_places_strategy.drawio.png.license b/_static/google_places_strategy.drawio.png.license new file mode 100644 index 0000000..4ff3a64 --- /dev/null +++ b/_static/google_places_strategy.drawio.png.license @@ -0,0 +1,2 @@ +SPDX-License-Identifier: MIT +SPDX-FileCopyrightText: 2023 Lucca Baumgärtner diff --git a/_static/jquery.js b/_static/jquery.js new file mode 100644 index 0000000..c4c6022 --- /dev/null +++ b/_static/jquery.js @@ -0,0 +1,2 @@ +/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=y.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=y.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),y.elements=c+" "+a,j(b)}function f(a){var b=x[a[v]];return b||(b={},w++,a[v]=w,x[w]=b),b}function g(a,c,d){if(c||(c=b),q)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():u.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||t.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),q)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return y.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(y,b.frag)}function j(a){a||(a=b);var d=f(a);return!y.shivCSS||p||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),q||i(a,d),a}function k(a){for(var b,c=a.getElementsByTagName("*"),e=c.length,f=RegExp("^(?:"+d().join("|")+")$","i"),g=[];e--;)b=c[e],f.test(b.nodeName)&&g.push(b.applyElement(l(b)));return g}function l(a){for(var b,c=a.attributes,d=c.length,e=a.ownerDocument.createElement(A+":"+a.nodeName);d--;)b=c[d],b.specified&&e.setAttribute(b.nodeName,b.nodeValue);return e.style.cssText=a.style.cssText,e}function m(a){for(var b,c=a.split("{"),e=c.length,f=RegExp("(^|[\\s,>+~])("+d().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),g="$1"+A+"\\:$2";e--;)b=c[e]=c[e].split("}"),b[b.length-1]=b[b.length-1].replace(f,g),c[e]=b.join("}");return c.join("{")}function n(a){for(var b=a.length;b--;)a[b].removeNode()}function o(a){function b(){clearTimeout(g._removeSheetTimer),d&&d.removeNode(!0),d=null}var d,e,g=f(a),h=a.namespaces,i=a.parentWindow;return!B||a.printShived?a:("undefined"==typeof h[A]&&h.add(A),i.attachEvent("onbeforeprint",function(){b();for(var f,g,h,i=a.styleSheets,j=[],l=i.length,n=Array(l);l--;)n[l]=i[l];for(;h=n.pop();)if(!h.disabled&&z.test(h.media)){try{f=h.imports,g=f.length}catch(o){g=0}for(l=0;g>l;l++)n.push(f[l]);try{j.push(h.cssText)}catch(o){}}j=m(j.reverse().join("")),e=k(a),d=c(a,j)}),i.attachEvent("onafterprint",function(){n(e),clearTimeout(g._removeSheetTimer),g._removeSheetTimer=setTimeout(b,500)}),a.printShived=!0,a)}var p,q,r="3.7.3",s=a.html5||{},t=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,u=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,v="_html5shiv",w=0,x={};!function(){try{var a=b.createElement("a");a.innerHTML="",p="hidden"in a,q=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){p=!0,q=!0}}();var y={elements:s.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:r,shivCSS:s.shivCSS!==!1,supportsUnknownElements:q,shivMethods:s.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=y,j(b);var z=/^$|\b(?:all|print)\b/,A="html5shiv",B=!q&&function(){var c=b.documentElement;return!("undefined"==typeof b.namespaces||"undefined"==typeof b.parentWindow||"undefined"==typeof c.applyElement||"undefined"==typeof c.removeNode||"undefined"==typeof a.attachEvent)}();y.type+=" print",y.shivPrint=o,o(b),"object"==typeof module&&module.exports&&(module.exports=y)}("undefined"!=typeof window?window:this,document); \ No newline at end of file diff --git a/_static/js/html5shiv.min.js b/_static/js/html5shiv.min.js new file mode 100644 index 0000000..cd1c674 --- /dev/null +++ b/_static/js/html5shiv.min.js @@ -0,0 +1,4 @@ +/** +* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed +*/ +!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3-pre",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document); \ No newline at end of file diff --git a/_static/js/theme.js b/_static/js/theme.js new file mode 100644 index 0000000..1fddb6e --- /dev/null +++ b/_static/js/theme.js @@ -0,0 +1 @@ +!function(n){var e={};function t(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return n[i].call(o.exports,o,o.exports,t),o.l=!0,o.exports}t.m=n,t.c=e,t.d=function(n,e,i){t.o(n,e)||Object.defineProperty(n,e,{enumerable:!0,get:i})},t.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,e){if(1&e&&(n=t(n)),8&e)return n;if(4&e&&"object"==typeof n&&n&&n.__esModule)return n;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&e&&"string"!=typeof n)for(var o in n)t.d(i,o,function(e){return n[e]}.bind(null,o));return i},t.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return t.d(e,"a",e),e},t.o=function(n,e){return Object.prototype.hasOwnProperty.call(n,e)},t.p="",t(t.s=0)}([function(n,e,t){t(1),n.exports=t(3)},function(n,e,t){(function(){var e="undefined"!=typeof window?window.jQuery:t(2);n.exports.ThemeNav={navBar:null,win:null,winScroll:!1,winResize:!1,linkScroll:!1,winPosition:0,winHeight:null,docHeight:null,isRunning:!1,enable:function(n){var t=this;void 0===n&&(n=!0),t.isRunning||(t.isRunning=!0,e((function(e){t.init(e),t.reset(),t.win.on("hashchange",t.reset),n&&t.win.on("scroll",(function(){t.linkScroll||t.winScroll||(t.winScroll=!0,requestAnimationFrame((function(){t.onScroll()})))})),t.win.on("resize",(function(){t.winResize||(t.winResize=!0,requestAnimationFrame((function(){t.onResize()})))})),t.onResize()})))},enableSticky:function(){this.enable(!0)},init:function(n){n(document);var e=this;this.navBar=n("div.wy-side-scroll:first"),this.win=n(window),n(document).on("click","[data-toggle='wy-nav-top']",(function(){n("[data-toggle='wy-nav-shift']").toggleClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift")})).on("click",".wy-menu-vertical .current ul li a",(function(){var t=n(this);n("[data-toggle='wy-nav-shift']").removeClass("shift"),n("[data-toggle='rst-versions']").toggleClass("shift"),e.toggleCurrent(t),e.hashChange()})).on("click","[data-toggle='rst-current-version']",(function(){n("[data-toggle='rst-versions']").toggleClass("shift-up")})),n("table.docutils:not(.field-list,.footnote,.citation)").wrap("
"),n("table.docutils.footnote").wrap("
"),n("table.docutils.citation").wrap("
"),n(".wy-menu-vertical ul").not(".simple").siblings("a").each((function(){var t=n(this);expand=n(''),expand.on("click",(function(n){return e.toggleCurrent(t),n.stopPropagation(),!1})),t.prepend(expand)}))},reset:function(){var n=encodeURI(window.location.hash)||"#";try{var e=$(".wy-menu-vertical"),t=e.find('[href="'+n+'"]');if(0===t.length){var i=$('.document [id="'+n.substring(1)+'"]').closest("div.section");0===(t=e.find('[href="#'+i.attr("id")+'"]')).length&&(t=e.find('[href="#"]'))}if(t.length>0){$(".wy-menu-vertical .current").removeClass("current").attr("aria-expanded","false"),t.addClass("current").attr("aria-expanded","true"),t.closest("li.toctree-l1").parent().addClass("current").attr("aria-expanded","true");for(let n=1;n<=10;n++)t.closest("li.toctree-l"+n).addClass("current").attr("aria-expanded","true");t[0].scrollIntoView()}}catch(n){console.log("Error expanding nav for anchor",n)}},onScroll:function(){this.winScroll=!1;var n=this.win.scrollTop(),e=n+this.winHeight,t=this.navBar.scrollTop()+(n-this.winPosition);n<0||e>this.docHeight||(this.navBar.scrollTop(t),this.winPosition=n)},onResize:function(){this.winResize=!1,this.winHeight=this.win.height(),this.docHeight=$(document).height()},hashChange:function(){this.linkScroll=!0,this.win.one("hashchange",(function(){this.linkScroll=!1}))},toggleCurrent:function(n){var e=n.closest("li");e.siblings("li.current").removeClass("current").attr("aria-expanded","false"),e.siblings().find("li.current").removeClass("current").attr("aria-expanded","false");var t=e.find("> ul li");t.length&&(t.removeClass("current").attr("aria-expanded","false"),e.toggleClass("current").attr("aria-expanded",(function(n,e){return"true"==e?"false":"true"})))}},"undefined"!=typeof window&&(window.SphinxRtdTheme={Navigation:n.exports.ThemeNav,StickyNav:n.exports.ThemeNav}),function(){for(var n=0,e=["ms","moz","webkit","o"],t=0;t0 + var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1 + var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1 + var s_v = "^(" + C + ")?" + v; // vowel in stem + + this.stemWord = function (w) { + var stem; + var suffix; + var firstch; + var origword = w; + + if (w.length < 3) + return w; + + var re; + var re2; + var re3; + var re4; + + firstch = w.substr(0,1); + if (firstch == "y") + w = firstch.toUpperCase() + w.substr(1); + + // Step 1a + re = /^(.+?)(ss|i)es$/; + re2 = /^(.+?)([^s])s$/; + + if (re.test(w)) + w = w.replace(re,"$1$2"); + else if (re2.test(w)) + w = w.replace(re2,"$1$2"); + + // Step 1b + re = /^(.+?)eed$/; + re2 = /^(.+?)(ed|ing)$/; + if (re.test(w)) { + var fp = re.exec(w); + re = new RegExp(mgr0); + if (re.test(fp[1])) { + re = /.$/; + w = w.replace(re,""); + } + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1]; + re2 = new RegExp(s_v); + if (re2.test(stem)) { + w = stem; + re2 = /(at|bl|iz)$/; + re3 = new RegExp("([^aeiouylsz])\\1$"); + re4 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re2.test(w)) + w = w + "e"; + else if (re3.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + else if (re4.test(w)) + w = w + "e"; + } + } + + // Step 1c + re = /^(.+?)y$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(s_v); + if (re.test(stem)) + w = stem + "i"; + } + + // Step 2 + re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step2list[suffix]; + } + + // Step 3 + re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + suffix = fp[2]; + re = new RegExp(mgr0); + if (re.test(stem)) + w = stem + step3list[suffix]; + } + + // Step 4 + re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/; + re2 = /^(.+?)(s|t)(ion)$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + if (re.test(stem)) + w = stem; + } + else if (re2.test(w)) { + var fp = re2.exec(w); + stem = fp[1] + fp[2]; + re2 = new RegExp(mgr1); + if (re2.test(stem)) + w = stem; + } + + // Step 5 + re = /^(.+?)e$/; + if (re.test(w)) { + var fp = re.exec(w); + stem = fp[1]; + re = new RegExp(mgr1); + re2 = new RegExp(meq1); + re3 = new RegExp("^" + C + v + "[^aeiouwxy]$"); + if (re.test(stem) || (re2.test(stem) && !(re3.test(stem)))) + w = stem; + } + re = /ll$/; + re2 = new RegExp(mgr1); + if (re.test(w) && re2.test(w)) { + re = /.$/; + w = w.replace(re,""); + } + + // and turn initial Y back to y + if (firstch == "y") + w = firstch.toLowerCase() + w.substr(1); + return w; + } +} + diff --git a/_static/minus.png b/_static/minus.png new file mode 100644 index 0000000..d96755f Binary files /dev/null and b/_static/minus.png differ diff --git a/_static/plus.png b/_static/plus.png new file mode 100644 index 0000000..7107cec Binary files /dev/null and b/_static/plus.png differ diff --git a/_static/pygments.css b/_static/pygments.css new file mode 100644 index 0000000..84ab303 --- /dev/null +++ b/_static/pygments.css @@ -0,0 +1,75 @@ +pre { line-height: 125%; } +td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +.highlight .hll { background-color: #ffffcc } +.highlight { background: #f8f8f8; } +.highlight .c { color: #3D7B7B; font-style: italic } /* Comment */ +.highlight .err { border: 1px solid #FF0000 } /* Error */ +.highlight .k { color: #008000; font-weight: bold } /* Keyword */ +.highlight .o { color: #666666 } /* Operator */ +.highlight .ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */ +.highlight .cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #9C6500 } /* Comment.Preproc */ +.highlight .cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */ +.highlight .c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */ +.highlight .gd { color: #A00000 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ +.highlight .gr { color: #E40000 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #008400 } /* Generic.Inserted */ +.highlight .go { color: #717171 } /* Generic.Output */ +.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #0044DD } /* Generic.Traceback */ +.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #008000 } /* Keyword.Pseudo */ +.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #B00040 } /* Keyword.Type */ +.highlight .m { color: #666666 } /* Literal.Number */ +.highlight .s { color: #BA2121 } /* Literal.String */ +.highlight .na { color: #687822 } /* Name.Attribute */ +.highlight .nb { color: #008000 } /* Name.Builtin */ +.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */ +.highlight .no { color: #880000 } /* Name.Constant */ +.highlight .nd { color: #AA22FF } /* Name.Decorator */ +.highlight .ni { color: #717171; font-weight: bold } /* Name.Entity */ +.highlight .ne { color: #CB3F38; font-weight: bold } /* Name.Exception */ +.highlight .nf { color: #0000FF } /* Name.Function */ +.highlight .nl { color: #767600 } /* Name.Label */ +.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */ +.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #19177C } /* Name.Variable */ +.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */ +.highlight .w { color: #bbbbbb } /* Text.Whitespace */ +.highlight .mb { color: #666666 } /* Literal.Number.Bin */ +.highlight .mf { color: #666666 } /* Literal.Number.Float */ +.highlight .mh { color: #666666 } /* Literal.Number.Hex */ +.highlight .mi { color: #666666 } /* Literal.Number.Integer */ +.highlight .mo { color: #666666 } /* Literal.Number.Oct */ +.highlight .sa { color: #BA2121 } /* Literal.String.Affix */ +.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */ +.highlight .sc { color: #BA2121 } /* Literal.String.Char */ +.highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */ +.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #BA2121 } /* Literal.String.Double */ +.highlight .se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */ +.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */ +.highlight .si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */ +.highlight .sx { color: #008000 } /* Literal.String.Other */ +.highlight .sr { color: #A45A77 } /* Literal.String.Regex */ +.highlight .s1 { color: #BA2121 } /* Literal.String.Single */ +.highlight .ss { color: #19177C } /* Literal.String.Symbol */ +.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */ +.highlight .fm { color: #0000FF } /* Name.Function.Magic */ +.highlight .vc { color: #19177C } /* Name.Variable.Class */ +.highlight .vg { color: #19177C } /* Name.Variable.Global */ +.highlight .vi { color: #19177C } /* Name.Variable.Instance */ +.highlight .vm { color: #19177C } /* Name.Variable.Magic */ +.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/_static/searchtools.js b/_static/searchtools.js new file mode 100644 index 0000000..7918c3f --- /dev/null +++ b/_static/searchtools.js @@ -0,0 +1,574 @@ +/* + * searchtools.js + * ~~~~~~~~~~~~~~~~ + * + * Sphinx JavaScript utilities for the full-text search. + * + * :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ +"use strict"; + +/** + * Simple result scoring code. + */ +if (typeof Scorer === "undefined") { + var Scorer = { + // Implement the following function to further tweak the score for each result + // The function takes a result array [docname, title, anchor, descr, score, filename] + // and returns the new score. + /* + score: result => { + const [docname, title, anchor, descr, score, filename] = result + return score + }, + */ + + // query matches the full name of an object + objNameMatch: 11, + // or matches in the last dotted part of the object name + objPartialMatch: 6, + // Additive scores depending on the priority of the object + objPrio: { + 0: 15, // used to be importantResults + 1: 5, // used to be objectResults + 2: -5, // used to be unimportantResults + }, + // Used when the priority is not in the mapping. + objPrioDefault: 0, + + // query found in title + title: 15, + partialTitle: 7, + // query found in terms + term: 5, + partialTerm: 2, + }; +} + +const _removeChildren = (element) => { + while (element && element.lastChild) element.removeChild(element.lastChild); +}; + +/** + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping + */ +const _escapeRegExp = (string) => + string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string + +const _displayItem = (item, searchTerms, highlightTerms) => { + const docBuilder = DOCUMENTATION_OPTIONS.BUILDER; + const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX; + const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX; + const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY; + const contentRoot = document.documentElement.dataset.content_root; + + const [docName, title, anchor, descr, score, _filename] = item; + + let listItem = document.createElement("li"); + let requestUrl; + let linkUrl; + if (docBuilder === "dirhtml") { + // dirhtml builder + let dirname = docName + "/"; + if (dirname.match(/\/index\/$/)) + dirname = dirname.substring(0, dirname.length - 6); + else if (dirname === "index/") dirname = ""; + requestUrl = contentRoot + dirname; + linkUrl = requestUrl; + } else { + // normal html builders + requestUrl = contentRoot + docName + docFileSuffix; + linkUrl = docName + docLinkSuffix; + } + let linkEl = listItem.appendChild(document.createElement("a")); + linkEl.href = linkUrl + anchor; + linkEl.dataset.score = score; + linkEl.innerHTML = title; + if (descr) { + listItem.appendChild(document.createElement("span")).innerHTML = + " (" + descr + ")"; + // highlight search terms in the description + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + } + else if (showSearchSummary) + fetch(requestUrl) + .then((responseData) => responseData.text()) + .then((data) => { + if (data) + listItem.appendChild( + Search.makeSearchSummary(data, searchTerms) + ); + // highlight search terms in the summary + if (SPHINX_HIGHLIGHT_ENABLED) // set in sphinx_highlight.js + highlightTerms.forEach((term) => _highlightText(listItem, term, "highlighted")); + }); + Search.output.appendChild(listItem); +}; +const _finishSearch = (resultCount) => { + Search.stopPulse(); + Search.title.innerText = _("Search Results"); + if (!resultCount) + Search.status.innerText = Documentation.gettext( + "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories." + ); + else + Search.status.innerText = _( + `Search finished, found ${resultCount} page(s) matching the search query.` + ); +}; +const _displayNextItem = ( + results, + resultCount, + searchTerms, + highlightTerms, +) => { + // results left, load the summary and display it + // this is intended to be dynamic (don't sub resultsCount) + if (results.length) { + _displayItem(results.pop(), searchTerms, highlightTerms); + setTimeout( + () => _displayNextItem(results, resultCount, searchTerms, highlightTerms), + 5 + ); + } + // search finished, update title and status message + else _finishSearch(resultCount); +}; + +/** + * Default splitQuery function. Can be overridden in ``sphinx.search`` with a + * custom function per language. + * + * The regular expression works by splitting the string on consecutive characters + * that are not Unicode letters, numbers, underscores, or emoji characters. + * This is the same as ``\W+`` in Python, preserving the surrogate pair area. + */ +if (typeof splitQuery === "undefined") { + var splitQuery = (query) => query + .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu) + .filter(term => term) // remove remaining empty strings +} + +/** + * Search Module + */ +const Search = { + _index: null, + _queued_query: null, + _pulse_status: -1, + + htmlToText: (htmlString) => { + const htmlElement = new DOMParser().parseFromString(htmlString, 'text/html'); + htmlElement.querySelectorAll(".headerlink").forEach((el) => { el.remove() }); + const docContent = htmlElement.querySelector('[role="main"]'); + if (docContent !== undefined) return docContent.textContent; + console.warn( + "Content block not found. Sphinx search tries to obtain it via '[role=main]'. Could you check your theme or template." + ); + return ""; + }, + + init: () => { + const query = new URLSearchParams(window.location.search).get("q"); + document + .querySelectorAll('input[name="q"]') + .forEach((el) => (el.value = query)); + if (query) Search.performSearch(query); + }, + + loadIndex: (url) => + (document.body.appendChild(document.createElement("script")).src = url), + + setIndex: (index) => { + Search._index = index; + if (Search._queued_query !== null) { + const query = Search._queued_query; + Search._queued_query = null; + Search.query(query); + } + }, + + hasIndex: () => Search._index !== null, + + deferQuery: (query) => (Search._queued_query = query), + + stopPulse: () => (Search._pulse_status = -1), + + startPulse: () => { + if (Search._pulse_status >= 0) return; + + const pulse = () => { + Search._pulse_status = (Search._pulse_status + 1) % 4; + Search.dots.innerText = ".".repeat(Search._pulse_status); + if (Search._pulse_status >= 0) window.setTimeout(pulse, 500); + }; + pulse(); + }, + + /** + * perform a search for something (or wait until index is loaded) + */ + performSearch: (query) => { + // create the required interface elements + const searchText = document.createElement("h2"); + searchText.textContent = _("Searching"); + const searchSummary = document.createElement("p"); + searchSummary.classList.add("search-summary"); + searchSummary.innerText = ""; + const searchList = document.createElement("ul"); + searchList.classList.add("search"); + + const out = document.getElementById("search-results"); + Search.title = out.appendChild(searchText); + Search.dots = Search.title.appendChild(document.createElement("span")); + Search.status = out.appendChild(searchSummary); + Search.output = out.appendChild(searchList); + + const searchProgress = document.getElementById("search-progress"); + // Some themes don't use the search progress node + if (searchProgress) { + searchProgress.innerText = _("Preparing search..."); + } + Search.startPulse(); + + // index already loaded, the browser was quick! + if (Search.hasIndex()) Search.query(query); + else Search.deferQuery(query); + }, + + /** + * execute search (requires search index to be loaded) + */ + query: (query) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + const allTitles = Search._index.alltitles; + const indexEntries = Search._index.indexentries; + + // stem the search terms and add them to the correct list + const stemmer = new Stemmer(); + const searchTerms = new Set(); + const excludedTerms = new Set(); + const highlightTerms = new Set(); + const objectTerms = new Set(splitQuery(query.toLowerCase().trim())); + splitQuery(query.trim()).forEach((queryTerm) => { + const queryTermLower = queryTerm.toLowerCase(); + + // maybe skip this "word" + // stopwords array is from language_data.js + if ( + stopwords.indexOf(queryTermLower) !== -1 || + queryTerm.match(/^\d+$/) + ) + return; + + // stem the word + let word = stemmer.stemWord(queryTermLower); + // select the correct list + if (word[0] === "-") excludedTerms.add(word.substr(1)); + else { + searchTerms.add(word); + highlightTerms.add(queryTermLower); + } + }); + + if (SPHINX_HIGHLIGHT_ENABLED) { // set in sphinx_highlight.js + localStorage.setItem("sphinx_highlight_terms", [...highlightTerms].join(" ")) + } + + // console.debug("SEARCH: searching for:"); + // console.info("required: ", [...searchTerms]); + // console.info("excluded: ", [...excludedTerms]); + + // array of [docname, title, anchor, descr, score, filename] + let results = []; + _removeChildren(document.getElementById("search-progress")); + + const queryLower = query.toLowerCase(); + for (const [title, foundTitles] of Object.entries(allTitles)) { + if (title.toLowerCase().includes(queryLower) && (queryLower.length >= title.length/2)) { + for (const [file, id] of foundTitles) { + let score = Math.round(100 * queryLower.length / title.length) + results.push([ + docNames[file], + titles[file] !== title ? `${titles[file]} > ${title}` : title, + id !== null ? "#" + id : "", + null, + score, + filenames[file], + ]); + } + } + } + + // search for explicit entries in index directives + for (const [entry, foundEntries] of Object.entries(indexEntries)) { + if (entry.includes(queryLower) && (queryLower.length >= entry.length/2)) { + for (const [file, id] of foundEntries) { + let score = Math.round(100 * queryLower.length / entry.length) + results.push([ + docNames[file], + titles[file], + id ? "#" + id : "", + null, + score, + filenames[file], + ]); + } + } + } + + // lookup as object + objectTerms.forEach((term) => + results.push(...Search.performObjectSearch(term, objectTerms)) + ); + + // lookup as search terms in fulltext + results.push(...Search.performTermsSearch(searchTerms, excludedTerms)); + + // let the scorer override scores with a custom scoring function + if (Scorer.score) results.forEach((item) => (item[4] = Scorer.score(item))); + + // now sort the results by score (in opposite order of appearance, since the + // display function below uses pop() to retrieve items) and then + // alphabetically + results.sort((a, b) => { + const leftScore = a[4]; + const rightScore = b[4]; + if (leftScore === rightScore) { + // same score: sort alphabetically + const leftTitle = a[1].toLowerCase(); + const rightTitle = b[1].toLowerCase(); + if (leftTitle === rightTitle) return 0; + return leftTitle > rightTitle ? -1 : 1; // inverted is intentional + } + return leftScore > rightScore ? 1 : -1; + }); + + // remove duplicate search results + // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept + let seen = new Set(); + results = results.reverse().reduce((acc, result) => { + let resultStr = result.slice(0, 4).concat([result[5]]).map(v => String(v)).join(','); + if (!seen.has(resultStr)) { + acc.push(result); + seen.add(resultStr); + } + return acc; + }, []); + + results = results.reverse(); + + // for debugging + //Search.lastresults = results.slice(); // a copy + // console.info("search results:", Search.lastresults); + + // print the results + _displayNextItem(results, results.length, searchTerms, highlightTerms); + }, + + /** + * search for object names + */ + performObjectSearch: (object, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const objects = Search._index.objects; + const objNames = Search._index.objnames; + const titles = Search._index.titles; + + const results = []; + + const objectSearchCallback = (prefix, match) => { + const name = match[4] + const fullname = (prefix ? prefix + "." : "") + name; + const fullnameLower = fullname.toLowerCase(); + if (fullnameLower.indexOf(object) < 0) return; + + let score = 0; + const parts = fullnameLower.split("."); + + // check for different match types: exact matches of full name or + // "last name" (i.e. last dotted part) + if (fullnameLower === object || parts.slice(-1)[0] === object) + score += Scorer.objNameMatch; + else if (parts.slice(-1)[0].indexOf(object) > -1) + score += Scorer.objPartialMatch; // matches in last name + + const objName = objNames[match[1]][2]; + const title = titles[match[0]]; + + // If more than one term searched for, we require other words to be + // found in the name/title/description + const otherTerms = new Set(objectTerms); + otherTerms.delete(object); + if (otherTerms.size > 0) { + const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase(); + if ( + [...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0) + ) + return; + } + + let anchor = match[3]; + if (anchor === "") anchor = fullname; + else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname; + + const descr = objName + _(", in ") + title; + + // add custom score for some objects according to scorer + if (Scorer.objPrio.hasOwnProperty(match[2])) + score += Scorer.objPrio[match[2]]; + else score += Scorer.objPrioDefault; + + results.push([ + docNames[match[0]], + fullname, + "#" + anchor, + descr, + score, + filenames[match[0]], + ]); + }; + Object.keys(objects).forEach((prefix) => + objects[prefix].forEach((array) => + objectSearchCallback(prefix, array) + ) + ); + return results; + }, + + /** + * search for full-text terms in the index + */ + performTermsSearch: (searchTerms, excludedTerms) => { + // prepare search + const terms = Search._index.terms; + const titleTerms = Search._index.titleterms; + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + + const scoreMap = new Map(); + const fileMap = new Map(); + + // perform the search on the required terms + searchTerms.forEach((word) => { + const files = []; + const arr = [ + { files: terms[word], score: Scorer.term }, + { files: titleTerms[word], score: Scorer.title }, + ]; + // add support for partial matches + if (word.length > 2) { + const escapedWord = _escapeRegExp(word); + Object.keys(terms).forEach((term) => { + if (term.match(escapedWord) && !terms[word]) + arr.push({ files: terms[term], score: Scorer.partialTerm }); + }); + Object.keys(titleTerms).forEach((term) => { + if (term.match(escapedWord) && !titleTerms[word]) + arr.push({ files: titleTerms[word], score: Scorer.partialTitle }); + }); + } + + // no match but word was a required one + if (arr.every((record) => record.files === undefined)) return; + + // found search word in contents + arr.forEach((record) => { + if (record.files === undefined) return; + + let recordFiles = record.files; + if (recordFiles.length === undefined) recordFiles = [recordFiles]; + files.push(...recordFiles); + + // set score for the word in each file + recordFiles.forEach((file) => { + if (!scoreMap.has(file)) scoreMap.set(file, {}); + scoreMap.get(file)[word] = record.score; + }); + }); + + // create the mapping + files.forEach((file) => { + if (fileMap.has(file) && fileMap.get(file).indexOf(word) === -1) + fileMap.get(file).push(word); + else fileMap.set(file, [word]); + }); + }); + + // now check if the files don't contain excluded terms + const results = []; + for (const [file, wordList] of fileMap) { + // check if all requirements are matched + + // as search terms with length < 3 are discarded + const filteredTermCount = [...searchTerms].filter( + (term) => term.length > 2 + ).length; + if ( + wordList.length !== searchTerms.size && + wordList.length !== filteredTermCount + ) + continue; + + // ensure that none of the excluded terms is in the search result + if ( + [...excludedTerms].some( + (term) => + terms[term] === file || + titleTerms[term] === file || + (terms[term] || []).includes(file) || + (titleTerms[term] || []).includes(file) + ) + ) + break; + + // select one (max) score for the file. + const score = Math.max(...wordList.map((w) => scoreMap.get(file)[w])); + // add result to the result list + results.push([ + docNames[file], + titles[file], + "", + null, + score, + filenames[file], + ]); + } + return results; + }, + + /** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words. + */ + makeSearchSummary: (htmlText, keywords) => { + const text = Search.htmlToText(htmlText); + if (text === "") return null; + + const textLower = text.toLowerCase(); + const actualStartPosition = [...keywords] + .map((k) => textLower.indexOf(k.toLowerCase())) + .filter((i) => i > -1) + .slice(-1)[0]; + const startWithContext = Math.max(actualStartPosition - 120, 0); + + const top = startWithContext === 0 ? "" : "..."; + const tail = startWithContext + 240 < text.length ? "..." : ""; + + let summary = document.createElement("p"); + summary.classList.add("context"); + summary.textContent = top + text.substr(startWithContext, 240).trim() + tail; + + return summary; + }, +}; + +_ready(Search.init); diff --git a/_static/sequence-diagram.svg b/_static/sequence-diagram.svg new file mode 100644 index 0000000..281a4cb --- /dev/null +++ b/_static/sequence-diagram.svg @@ -0,0 +1,4 @@ + + + +
:Base Data Collector
:Base Data Colle...
return
return
:Lead Form
:Lead Form
newLead()
newLead()
:Controller
:Controller
getPrediction()
getPrediction()
collectData()
collectData()
savePrediction()
savePrediction()
:Estimated Value Predictor
:Estimated Value...
return
return
Text is not SVG - cannot display
diff --git a/_static/sequence-diagram.svg.license b/_static/sequence-diagram.svg.license new file mode 100644 index 0000000..19521aa --- /dev/null +++ b/_static/sequence-diagram.svg.license @@ -0,0 +1,2 @@ +SPDX-License-Identifier: MIT +SPDX-FileCopyrightText: 2023 Lucca Baumgärtner diff --git a/_static/sphinx_highlight.js b/_static/sphinx_highlight.js new file mode 100644 index 0000000..8a96c69 --- /dev/null +++ b/_static/sphinx_highlight.js @@ -0,0 +1,154 @@ +/* Highlighting utilities for Sphinx HTML documentation. */ +"use strict"; + +const SPHINX_HIGHLIGHT_ENABLED = true + +/** + * highlight a given string on a node by wrapping it in + * span elements with the given class name. + */ +const _highlight = (node, addItems, text, className) => { + if (node.nodeType === Node.TEXT_NODE) { + const val = node.nodeValue; + const parent = node.parentNode; + const pos = val.toLowerCase().indexOf(text); + if ( + pos >= 0 && + !parent.classList.contains(className) && + !parent.classList.contains("nohighlight") + ) { + let span; + + const closestNode = parent.closest("body, svg, foreignObject"); + const isInSVG = closestNode && closestNode.matches("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.classList.add(className); + } + + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + const rest = document.createTextNode(val.substr(pos + text.length)); + parent.insertBefore( + span, + parent.insertBefore( + rest, + node.nextSibling + ) + ); + node.nodeValue = val.substr(0, pos); + /* There may be more occurrences of search term in this node. So call this + * function recursively on the remaining fragment. + */ + _highlight(rest, addItems, text, className); + + if (isInSVG) { + const rect = document.createElementNS( + "http://www.w3.org/2000/svg", + "rect" + ); + const bbox = parent.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute("class", className); + addItems.push({ parent: parent, target: rect }); + } + } + } else if (node.matches && !node.matches("button, select, textarea")) { + node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); + } +}; +const _highlightText = (thisNode, text, className) => { + let addItems = []; + _highlight(thisNode, addItems, text, className); + addItems.forEach((obj) => + obj.parent.insertAdjacentElement("beforebegin", obj.target) + ); +}; + +/** + * Small JavaScript module for the documentation. + */ +const SphinxHighlight = { + + /** + * highlight the search words provided in localstorage in the text + */ + highlightSearchWords: () => { + if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight + + // get and clear terms from localstorage + const url = new URL(window.location); + const highlight = + localStorage.getItem("sphinx_highlight_terms") + || url.searchParams.get("highlight") + || ""; + localStorage.removeItem("sphinx_highlight_terms") + url.searchParams.delete("highlight"); + window.history.replaceState({}, "", url); + + // get individual terms from highlight string + const terms = highlight.toLowerCase().split(/\s+/).filter(x => x); + if (terms.length === 0) return; // nothing to do + + // There should never be more than one element matching "div.body" + const divBody = document.querySelectorAll("div.body"); + const body = divBody.length ? divBody[0] : document.querySelector("body"); + window.setTimeout(() => { + terms.forEach((term) => _highlightText(body, term, "highlighted")); + }, 10); + + const searchBox = document.getElementById("searchbox"); + if (searchBox === null) return; + searchBox.appendChild( + document + .createRange() + .createContextualFragment( + '" + ) + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms") + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) return; + if (DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS && (event.key === "Escape")) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(() => { + /* Do not call highlightSearchWords() when we are on the search page. + * It will highlight words from the *previous* search query. + */ + if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); + SphinxHighlight.initEscapeListener(); +}); diff --git a/bdc.html b/bdc.html new file mode 100644 index 0000000..55ef6d2 --- /dev/null +++ b/bdc.html @@ -0,0 +1,457 @@ + + + + + + + bdc package — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

bdc package

+
+

Subpackages

+
+ +
+
+
+

Submodules

+
+
+

bdc.pipeline module

+
+
+class bdc.pipeline.Pipeline(steps, limit: int | None = None)[source]
+

Bases: object

+
+
+run()[source]
+
+ +
+ +
+
+

Module contents

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/bdc.steps.helpers.html b/bdc.steps.helpers.html new file mode 100644 index 0000000..1f2e81f --- /dev/null +++ b/bdc.steps.helpers.html @@ -0,0 +1,449 @@ + + + + + + + bdc.steps.helpers package — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

bdc.steps.helpers package

+
+

Submodules

+
+
+

bdc.steps.helpers.generate_hash_leads module

+
+
+class bdc.steps.helpers.generate_hash_leads.LeadHashGenerator[source]
+

Bases: object

+
+
+BASE_PATH = '/home/runner/work/amos2023ws06-sales-lead-qualifier/amos2023ws06-sales-lead-qualifier/src/bdc/steps/helpers'
+
+ +
+
+hash_check(lead_data: Series, data_fill_function: callable, step_name: str, fields_tofill: list[str], *args, **kwargs)[source]
+
+ +
+
+hash_lead(lead_data)[source]
+
+ +
+ +
+
+

bdc.steps.helpers.offeneregister_api module

+
+
+class bdc.steps.helpers.offeneregister_api.OffeneRegisterAPI[source]
+

Bases: object

+

A class that retrieves company data from various sources based on given parameters.

+
+
+_find_from_Positions_by_firstName_and_lastName(last_name
+

str, first_name: str) -> dict: +Retrieves company data from Positions table based on the last name and first name of a person.

+
+ +
+
+_find_row_by_companyId(url
+

str, company_id: str) -> dict: +Finds and retrieves the row data for a given company ID from a specified URL.

+
+ +
+
+_find_from_Capital_by_companyId(company_id
+

str) -> dict: +Retrieves company data from the Capital database using the provided company ID.

+
+ +
+
+_find_from_Addresses_by_companyId(company_id
+

str) -> dict: +Retrieves the row from the Addresses table based on the given company ID.

+
+ +
+
+_find_from_Objectives_by_companyId(company_id
+

str) -> dict: +Retrieves the row from Objectives by the given company ID.

+
+ +
+
+_find_from_Names_by_companyId(company_id
+

str) -> dict: +Retrieves company data by company ID from the offerenregister.de website.

+
+ +
+
+find_companyName_by_lastName_firstName(last_name
+

str, first_name: str) -> str: +Finds the company name by the last name and first name of a person.

+
+ +
+
+find_companyCapitals_by_lastName_firstName(last_name
+

str, first_name: str) -> tuple: +Retrieves the capital amount and currency of a company based on the last name and first name of a person.

+
+ +
+
+find_companyObjective_by_lastName_firstName(last_name
+

str, first_name: str) -> str or None: +Finds the company objective based on the last name and first name of a person.

+
+ +
+
+find_companyAddress_by_lastName_firstName(last_name, first_name)[source]
+
+ +
+
+find_companyCapitals_by_lastName_firstName(last_name, first_name)[source]
+

Retrieves the capital amount and currency of a company based on the last name and first name of a person.

+
+
Parameters:
+
    +
  • last_name (str) – The last name of the person.

  • +
  • first_name (str) – The first name of the person.

  • +
+
+
Returns:
+

A tuple containing the capital amount and currency of the company. If the company or capital information is not found, returns (None, None).

+
+
Return type:
+

tuple

+
+
+
+ +
+
+find_companyName_by_lastName_firstName(last_name, first_name)[source]
+

Finds the company name by the last name and first name of a person.

+
+
Parameters:
+
    +
  • last_name (str) – The last name of the person.

  • +
  • first_name (str) – The first name of the person.

  • +
+
+
Returns:
+

The name of the company if found, None otherwise.

+
+
Return type:
+

str

+
+
+
+ +
+
+find_companyObjective_by_lastName_firstName(last_name, first_name)[source]
+

Finds the company objective based on the last name and first name of a person.

+
+
Parameters:
+
    +
  • last_name (str) – The last name of the person.

  • +
  • first_name (str) – The first name of the person.

  • +
+
+
Returns:
+

The company objective if found, None otherwise.

+
+
Return type:
+

str or None

+
+
+
+ +
+ +
+
+

bdc.steps.helpers.text_analyzer module

+
+
+class bdc.steps.helpers.text_analyzer.TextAnalyzer(*args, **kwargs)[source]
+

Bases: object

+

A class that provides text analysis functionalities such as spell checking, correction, and error detection.

+
+
+TARGET_LANG = 'en'
+
+ +
+
+calculate_sentiment_analysis_score(inp_text, lang='en')[source]
+

Calculates the sentiment analysis of the input text.

+
+
Parameters:
+
    +
  • inp_text (str) – The input text to analyze for sentiment analysis.

  • +
  • lang (str, optional) – The language of the input text. Defaults to “english”.

  • +
+
+
Returns:
+

The sentiment analysis of the input text, or None if an error occurs.

+
+
Return type:
+

float

+
+
+
+ +
+
+correct_text(text, language='en')[source]
+

Correct the spelling of the given text using the specified language.

+
+
Parameters:
+
    +
  • text (str) – The text to be corrected.

  • +
  • language (str, optional) – The language setting. Defaults to “en”.

  • +
+
+
Returns:
+

The corrected text.

+
+
Return type:
+

str

+
+
+
+ +
+
+find_number_of_grammatical_errors(inp_text, language='en')[source]
+

Finds the number of grammatical errors in the input text.

+
+
Parameters:
+
    +
  • inp_text (str) – The input text to analyze for grammatical errors.

  • +
  • language (str, optional) – The language of the input text. Defaults to “en”.

  • +
  • max_retries (int, optional) – The maximum number of retry attempts. Defaults to 3.

  • +
+
+
Returns:
+

The number of grammatical errors found in the input text, or None if an error occurs.

+
+
Return type:
+

int

+
+
+
+ +
+
+find_number_of_spelling_errors(text, language='en')[source]
+

Find the number of spelling errors in the given text using the specified language.

+
+
Parameters:
+
    +
  • text (str) – The text to be checked.

  • +
  • language (str, optional) – The language setting. Defaults to “en”.

  • +
+
+
Returns:
+

The number of spelling errors.

+
+
Return type:
+

int

+
+
+
+ +
+
+find_spelling_errors(text, language='en')[source]
+

Find the spelling errors in the given text using the specified language.

+
+
Parameters:
+
    +
  • text (str) – The text to be checked.

  • +
  • language (str, optional) – The language setting. Defaults to “en”.

  • +
+
+
Returns:
+

A list of spelling errors.

+
+
Return type:
+

list

+
+
+
+ +
+
+translate(inp_text, source_lang='auto', target_lang='en')[source]
+

Translates the input text to the target language.

+
+
Parameters:
+
    +
  • inp_text (str) – The input text to translate.

  • +
  • source_lang (str, optional) – The source language of the input text. Defaults to “auto”.

  • +
  • target_lang (str, optional) – The target language of the input text. Defaults to TARGET_LANG.

  • +
+
+
Returns:
+

The translated text, or None if an error occurs.

+
+
Return type:
+

str

+
+
+
+ +
+ +
+
+

Module contents

+
+
+bdc.steps.helpers.get_lead_hash_generator() LeadHashGenerator[source]
+
+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/bdc.steps.html b/bdc.steps.html new file mode 100644 index 0000000..8f9cb51 --- /dev/null +++ b/bdc.steps.html @@ -0,0 +1,2074 @@ + + + + + + + bdc.steps package — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

bdc.steps package

+
+

Subpackages

+ +
+
+

Submodules

+
+
+

bdc.steps.analyze_emails module

+
+
+class bdc.steps.analyze_emails.AnalyzeEmails(force_refresh: bool = False)[source]
+

Bases: Step

+

A pipeline step performing various preprocessing steps with the given email address. +The following columns will be added on successful processing:

+
    +
  • domain: The custom domain name/website if any

  • +
  • email_valid: Boolean result of email check

  • +
  • first_name_in_account: Boolean, True if the given first name is part of the email account name

  • +
  • last_name_in_account: Boolean, True if the given last name is part of the email account name

  • +
+
+
+name
+

Name of this step, used for logging

+
+
Type:
+

str

+
+
+
+ +
+
+added_cols
+

List of fields that will be added to the main dataframe by executing this step

+
+
Type:
+

list[str]

+
+
+
+ +
+
+required_cols
+

List of fields that are required to be existent in the input dataframe before performing this step

+
+
Type:
+

list[str]

+
+
+
+ +
+
Added Columns:

domain (str): The custom domain name/website if any +email_valid (bool): Boolean result of email check +first_name_in_account (bool): Boolean, True if the given first name is part of the email account name +last_name_in_account (bool): Boolean, True if the given last name is part of the email account name

+
+
+
+
+added_cols: list[str] = ['domain', 'email_valid', 'first_name_in_account', 'last_name_in_account']
+
+ +
+
+finish()[source]
+

Finish the execution. Print a report or clean up temporary files. Will not be executed if verify() fails.

+
+ +
+
+load_data()[source]
+

Load data for this processing step. This could be an API call or reading from a CSV file. Can also be empty +if self.df is used.

+
+ +
+
+name: str = 'Analyze-Emails'
+
+ +
+
+required_cols: list[str] = ['Email', 'First Name', 'Last Name']
+
+ +
+
+run()[source]
+

Perform the actual processing step. Will not be executed if verify() fails.

+
+
Raises:
+

StepError

+
+
+
+ +
+
+verify()[source]
+

Verify that the data has been loaded correctly and is present in a format that can be processed by this step. +If this fails, run() and finish() will not be executed.

+
+ +
+ +
+
+bdc.steps.analyze_emails.analyze_email_account(lead) Series[source]
+
+ +
+
+bdc.steps.analyze_emails.extract_custom_domain(email: str) Series[source]
+
+ +
+
+

bdc.steps.analyze_reviews module

+
+
+class bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer(force_refresh: bool = False)[source]
+

Bases: Step

+

A class that performs sentiment analysis on reviews using GPT-4 model.

+
+
+name
+

The name of the step.

+
+
Type:
+

str

+
+
+
+ +
+
+model
+

The GPT model to be used for sentiment analysis.

+
+
Type:
+

str

+
+
+
+ +
+
+model_encoding_name
+

The encoding name of the GPT model.

+
+
Type:
+

str

+
+
+
+ +
+
+MAX_PROMPT_TOKENS
+

The maximum number of tokens allowed for a prompt.

+
+
Type:
+

int

+
+
+
+ +
+
+no_answer
+

The default value for no answer.

+
+
Type:
+

str

+
+
+
+ +
+
+gpt_required_fields
+

The required fields for GPT analysis.

+
+
Type:
+

dict

+
+
+
+ +
+
+system_message_for_sentiment_analysis
+

The system message for sentiment analysis.

+
+
Type:
+

str

+
+
+
+ +
+
+user_message_for_sentiment_analysis
+

The user message for sentiment analysis.

+
+
Type:
+

str

+
+
+
+ +
+
+extracted_col_name
+

The name of the column to store the sentiment scores.

+
+
Type:
+

str

+
+
+
+ +
+
+added_cols
+

The list of additional columns to be added to the DataFrame.

+
+
Type:
+

list

+
+
+
+ +
+
+gpt
+

The GPT instance for sentiment analysis.

+
+
Type:
+

openai.OpenAI

+
+
+
+ +
+
+load_data()[source]
+

Loads the GPT model.

+
+ +
+
+verify()[source]
+

Verifies the validity of the API key and DataFrame.

+
+ +
+
+run()[source]
+

Runs the sentiment analysis on the reviews.

+
+ +
+
+finish()[source]
+

Finishes the sentiment analysis step.

+
+ +
+
+run_sentiment_analysis(place_id)[source]
+

Runs sentiment analysis on the reviews of a lead.

+
+ +
+
+gpt_sentiment_analyze_review(review_list)[source]
+

Calculates the sentiment score using GPT.

+
+ +
+
+extract_text_from_reviews(reviews_list)[source]
+

Extracts text from reviews and removes line characters.

+
+ +
+
+num_tokens_from_string(text)[source]
+

Returns the number of tokens in a text string.

+
+ +
+
+batch_reviews(reviews, max_tokens)[source]
+

Batches reviews into smaller batches based on token limit.

+
+ +
+
Added Columns:

reviews_sentiment_score (float): The sentiment score of the reviews.

+
+
+
+
+MAX_PROMPT_TOKENS = 4096
+
+ +
+
+added_cols: list[str] = ['reviews_sentiment_score']
+
+ +
+
+batch_reviews(reviews, max_tokens=4096)[source]
+

Batches reviews into smaller batches based on token limit.

+
+
Parameters:
+
    +
  • reviews – The list of reviews.

  • +
  • max_tokens (int) – The maximum number of tokens allowed for a batch.

  • +
+
+
Returns:
+

The list of batches.

+
+
Return type:
+

list

+
+
+
+ +
+
+extract_text_from_reviews(reviews_list)[source]
+

Extracts text from reviews and removes line characters.

+
+
Parameters:
+

reviews_list – The list of reviews.

+
+
Returns:
+

The list of formatted review texts.

+
+
Return type:
+

list

+
+
+
+ +
+
+extracted_col_name = 'reviews_sentiment_score'
+
+ +
+
+finish() None[source]
+

Finish the execution. Print a report or clean up temporary files. Will not be executed if verify() fails.

+
+ +
+
+gpt = None
+
+ +
+
+gpt_calculate_avg_sentiment_score(reviews)[source]
+

Calculates the average sentiment score for a list of reviews using GPT.

+
+
Parameters:
+

reviews (list) – A list of review texts.

+
+
Returns:
+

The average sentiment score.

+
+
Return type:
+

float

+
+
+
+ +
+
+gpt_required_fields = {'place_id': 'google_places_place_id'}
+
+ +
+
+gpt_sentiment_analyze_review(review_list)[source]
+

GPT calculates the sentiment score considering the reviews.

+
+
Parameters:
+

review_list – The list of reviews.

+
+
Returns:
+

The sentiment score calculated by GPT.

+
+
Return type:
+

float

+
+
+
+ +
+
+load_data() None[source]
+

Loads the GPT model.

+
+ +
+
+model = 'gpt-4'
+
+ +
+
+model_encoding_name = 'cl100k_base'
+
+ +
+
+name: str = 'GPT-Review-Sentiment-Analyzer'
+
+ +
+
+no_answer = 'None'
+
+ +
+
+num_tokens_from_string(text: str)[source]
+

Returns the number of tokens in a text string.

+
+
Parameters:
+

text (str) – The input text.

+
+
Returns:
+

The number of tokens in the text.

+
+
Return type:
+

int

+
+
+
+ +
+
+required_cols: list[str] = dict_values(['google_places_place_id'])
+
+ +
+
+run() DataFrame[source]
+

Runs the sentiment analysis on the reviews.

+
+
Returns:
+

The DataFrame with the sentiment scores added.

+
+
Return type:
+

DataFrame

+
+
+
+ +
+
+run_sentiment_analysis(place_id)[source]
+

Runs sentiment analysis on reviews of lead extracted from company’s website.

+
+
Parameters:
+

place_id – The ID of the place.

+
+
Returns:
+

The average sentiment score of the reviews.

+
+
Return type:
+

float

+
+
+
+ +
+
+system_message_for_sentiment_analysis = "You are review sentiment analyzer, you being provided reviews of the companies. You analyze the review and come up with the score between range [-1, 1], if no reviews then just answer with 'None'"
+
+ +
+
+text_analyzer = <bdc.steps.helpers.text_analyzer.TextAnalyzer object>
+
+ +
+
+textblob_calculate_avg_sentiment_score(reviews)[source]
+

Calculates the average sentiment score for a list of reviews using TextBlob sentiment analysis.

+
+
Parameters:
+

reviews (list) – A list of dictionaries containing review text and language information.

+
+
Returns:
+

The average sentiment score for the reviews.

+
+
Return type:
+

float

+
+
+
+ +
+
+user_message_for_sentiment_analysis = 'Sentiment analyze the reviews  and provide me a score between range [-1, 1]  : {}'
+
+ +
+
+verify() bool[source]
+

Verifies the validity of the API key and DataFrame.

+
+
Returns:
+

True if the API key and DataFrame are valid, False otherwise.

+
+
Return type:
+

bool

+
+
+
+ +
+ +
+
+class bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer(force_refresh: bool = False)[source]
+

Bases: Step

+

A step class that enhances review insights for smart review analysis.

+
+
+name
+

The name of the step.

+
+
Type:
+

str

+
+
+
+ +
+
+required_fields
+

A dictionary of required fields for the step.

+
+
Type:
+

dict

+
+
+
+ +
+
+language_tools
+

A dictionary of language tools for different languages.

+
+
Type:
+

dict

+
+
+
+ +
+
+MIN_RATINGS_COUNT
+

The minimum number of ratings required to identify polarization.

+
+
Type:
+

int

+
+
+
+ +
+
+RATING_DOMINANCE_THRESHOLD
+

The threshold for high or low rating dominance in decimal.

+
+
Type:
+

float

+
+
+
+ +
+
+added_cols
+

A list of added columns for the enhanced review insights.

+
+
Type:
+

list

+
+
+
+ +
+
+load_data()[source]
+

Loads the data for the step.

+
+ +
+
+verify()[source]
+

Verifies if the required fields are present in the data.

+
+ +
+
+run()[source]
+

Runs the step and enhances the review insights.

+
+ +
+
+finish()[source]
+

Finishes the step.

+
+ +
+
+_get_language_tool(lang)
+

Get the language tool for the specified language.

+
+ +
+
+_enhance_review_insights(lead)[source]
+

Enhances the review insights for a given lead.

+
+ +
+
+_analyze_rating_trend(rating_time)[source]
+

Analyzes the general trend of ratings over time.

+
+ +
+
+_quantify_polarization(ratings)[source]
+

Analyzes and quantifies the polarization in a list of ratings.

+
+ +
+
+_determine_polarization_type(polarization_score, highest_rating_ratio, lowest_rating_ratio, threshold)[source]
+

Determines the type of polarization based on rating ratios and a threshold.

+
+ +
+
+_calculate_average_grammatical_score(reviews)[source]
+

Calculates the average grammatical score for a list of reviews.

+
+ +
+
+_calculate_score(review)[source]
+

Calculates the score for a review.

+
+ +
+
+_grammatical_errors(text, lang)
+

Calculates the number of grammatical errors in a text.

+
+ +
+
Added Columns:

review_avg_grammatical_score (float): The average grammatical score of the reviews. +review_polarization_type (str): The type of polarization in the reviews. +review_polarization_score (float): The score of polarization in the reviews. +review_highest_rating_ratio (float): The ratio of highest ratings in the reviews. +review_lowest_rating_ratio (float): The ratio of lowest ratings in the reviews. +review_rating_trend (float): The trend of ratings over time.

+
+
+
+
+MIN_RATINGS_COUNT = 1
+
+ +
+
+RATING_DOMINANCE_THRESHOLD = 0.4
+
+ +
+
+added_cols: list[str] = ['review_avg_grammatical_score', 'review_polarization_type', 'review_polarization_score', 'review_highest_rating_ratio', 'review_lowest_rating_ratio', 'review_rating_trend']
+
+ +
+
+finish() None[source]
+

Finishes the step.

+
+ +
+
+load_data() None[source]
+

Loads the data for the step.

+
+ +
+
+name: str = 'Smart-Review-Insights-Enhancer'
+
+ +
+
+required_fields = {'place_id': 'google_places_place_id'}
+
+ +
+
+run() DataFrame[source]
+

Runs the step and enhances the review insights.

+
+
Returns:
+

The enhanced DataFrame with the added review insights.

+
+
Return type:
+

DataFrame

+
+
+
+ +
+
+text_analyzer = <bdc.steps.helpers.text_analyzer.TextAnalyzer object>
+
+ +
+
+verify() bool[source]
+

Verifies if the required fields are present in the data.

+
+
Returns:
+

True if the required fields are present, False otherwise.

+
+
Return type:
+

bool

+
+
+
+ +
+ +
+
+bdc.steps.analyze_reviews.check_api_key(api_key, api_name)[source]
+

Checks if an API key is provided for a specific API.

+
+
Parameters:
+
    +
  • api_key (str) – The API key to be checked.

  • +
  • api_name (str) – The name of the API.

  • +
+
+
Raises:
+

StepError – If the API key is not provided.

+
+
Returns:
+

True if the API key is provided, False otherwise.

+
+
Return type:
+

bool

+
+
+
+ +
+
+bdc.steps.analyze_reviews.is_review_valid(review)[source]
+

Checks if the review is valid (has text and original language).

+

Parameters: +review (dict): A dictionary representing a review.

+

Returns: +bool: True if the review is valid, False otherwise.

+
+ +
+
+bdc.steps.analyze_reviews.log = <CustomLogger AMOS-APP (DEBUG)>
+

HELPER FUNCTIONS

+
+ +
+
+

bdc.steps.google_places module

+
+
+class bdc.steps.google_places.GooglePlaces(force_refresh: bool = False)[source]
+

Bases: Step

+

The GooglePlaces step will try to find the correct business entry in the Google Maps database. It will save basic +information along with the place id, that can be used to retrieve further detailed information and a confidence +score that should indicate the confidence in having found the correct result. Confidence can vary based on the data +source used for identifying the business and if multiple sources are used confidence is higher when results match.

+
+
+name
+

Name of this step, used for logging and as a column prefix

+
+
Type:
+

str

+
+
+
+ +
+
+added_cols
+

List of fields that will be added to the main dataframe by executing this step

+
+
Type:
+

list[str]

+
+
+
+ +
+
+required_cols
+

List of fields that are required to be existent in the input dataframe before performing this step

+
+
Type:
+

list[str]

+
+
+
+ +
+
Added Columns:

google_places_place_id (str): The place id of the business +google_places_business_status (str): The business status of the business +google_places_formatted_address (str): The formatted address of the business +google_places_name (str): The name of the business +google_places_user_ratings_total (int): The number of user ratings of the business +google_places_rating (float): The rating of the business +google_places_price_level (int): The price level of the business +google_places_candidate_count_mail (int): The number of candidates found by mail search +google_places_candidate_count_phone (int): The number of candidates found by phone search +google_places_place_id_matches_phone_search (bool): Whether the place id found by mail search matches the one found by phone search +google_places_confidence (float): A confidence score for the results

+
+
+
+
+added_cols: list[str] = ['google_places_place_id', 'google_places_business_status', 'google_places_formatted_address', 'google_places_name', 'google_places_user_ratings_total', 'google_places_rating', 'google_places_price_level', 'google_places_candidate_count_mail', 'google_places_candidate_count_phone', 'google_places_place_id_matches_phone_search', 'google_places_confidence']
+
+ +
+
+api_fields = ['place_id', 'business_status', 'formatted_address', 'name', 'user_ratings_total', 'rating', 'price_level']
+
+ +
+
+calculate_confidence(results_list, lead) float | None[source]
+

Calculate some confidence score, representing how sure we are to have found the correct Google Place +(using super secret, patented AI algorithm :P) +:param results_list: +:return: confidence

+
+ +
+
+df_fields = ['place_id', 'business_status', 'formatted_address', 'name', 'user_ratings_total', 'rating', 'price_level', 'candidate_count_mail', 'candidate_count_phone', 'place_id_matches_phone_search', 'confidence']
+
+ +
+
+finish() None[source]
+

Finish the execution. Print a report or clean up temporary files. Will not be executed if verify() fails.

+
+ +
+
+get_data_from_google_api(lead_row)[source]
+

Request Google Places Text Search API

+
+ +
+
+get_first_place_candidate(query, input_type) -> (<class 'dict'>, <class 'int'>)[source]
+
+ +
+
+gmaps = None
+
+ +
+
+load_data() None[source]
+

Make sure that the API key for Google places is present and construct the API client

+
+ +
+
+name: str = 'Google_Places'
+
+ +
+
+required_cols: list[str] = ['Email', 'domain', 'first_name_in_account', 'last_name_in_account', 'number_formatted']
+
+ +
+
+run() DataFrame[source]
+

Perform the actual processing step. Will not be executed if verify() fails.

+
+
Raises:
+

StepError

+
+
+
+ +
+
+verify() bool[source]
+

Verify that the data has been loaded correctly and is present in a format that can be processed by this step. +If this fails, run() and finish() will not be executed.

+
+ +
+ +
+
+

bdc.steps.google_places_detailed module

+
+
+class bdc.steps.google_places_detailed.GooglePlacesDetailed(force_refresh: bool = False)[source]
+

Bases: Step

+

The GooglePlacesDetailed step will try to gather detailed information for a given google business entry, identified +by the place ID. This information could be the website link, the review text and the business type. Reviews will +be saved to a separate location based on the persistence settings this could be local or AWS S3.

+
+
+name
+

Name of this step, used for logging

+
+
Type:
+

str

+
+
+
+ +
+
+added_cols
+

List of fields that will be added to the main dataframe by executing this step

+
+
Type:
+

list[str]

+
+
+
+ +
+
+required_cols
+

List of fields that are required to be existent in the input dataframe before performing this step

+
+
Type:
+

list[str]

+
+
+
+ +
+
Added Columns:

google_places_detailed_website (str): The website of the company from google places +google_places_detailed_type (str): The type of the company from google places

+
+
+
+
+added_cols: list[str] = ['google_places_detailed_website', 'google_places_detailed_type']
+
+ +
+
+api_fields = ['website', 'type', 'reviews']
+
+ +
+
+api_fields_output = ['website', 'types']
+
+ +
+
+df_fields = ['website', 'type']
+
+ +
+
+finish() None[source]
+

Finish the execution. Print a report or clean up temporary files. Will not be executed if verify() fails.

+
+ +
+
+get_data_from_detailed_google_api(lead_row)[source]
+
+ +
+
+gmaps = None
+
+ +
+
+load_data() None[source]
+

Load data for this processing step. This could be an API call or reading from a CSV file. Can also be empty +if self.df is used.

+
+ +
+
+name: str = 'Google_Places_Detailed'
+
+ +
+
+required_cols: list[str] = ['google_places_place_id']
+
+ +
+
+run() DataFrame[source]
+

Perform the actual processing step. Will not be executed if verify() fails.

+
+
Raises:
+

StepError

+
+
+
+ +
+
+verify() bool[source]
+

Verify that the data has been loaded correctly and is present in a format that can be processed by this step. +If this fails, run() and finish() will not be executed.

+
+ +
+ +
+
+

bdc.steps.gpt_summarizer module

+
+
+class bdc.steps.gpt_summarizer.GPTSummarizer(force_refresh: bool = False)[source]
+

Bases: Step

+

The GPTSummarizer step will attempt to download a businesses website in raw html format and pass this information +to OpenAIs GPT, which will then attempt to summarize the raw contents and extract valuable information for a +salesperson.

+
+
+name
+

Name of this step, used for logging

+
+
Type:
+

str

+
+
+
+ +
+
+added_cols
+

List of fields that will be added to the main dataframe by executing this step

+
+
Type:
+

list[str]

+
+
+
+ +
+
+required_cols
+

List of fields that are required to be existent in the input dataframe before performing this +step

+
+
Type:
+

list[str]

+
+
+
+ +
+
Added Columns:

sales_person_summary (str): The summary of the company website for the salesperson using GPT

+
+
+
+
+added_cols: list[str] = ['sales_person_summary']
+
+ +
+
+client = None
+
+ +
+
+extract_the_raw_html_and_parse(url)[source]
+
+ +
+
+extracted_col_name_website_summary = 'sales_person_summary'
+
+ +
+
+finish() None[source]
+

Finish the execution. Print a report or clean up temporary files. Will not be executed if verify() fails.

+
+ +
+
+gpt_required_fields = {'place_id': 'google_places_place_id', 'website': 'google_places_detailed_website'}
+
+ +
+
+load_data() None[source]
+

Load data for this processing step. This could be an API call or reading from a CSV file. Can also be empty +if self.df is used.

+
+ +
+
+model = 'gpt-4'
+
+ +
+
+name: str = 'GPT-Summarizer'
+
+ +
+
+no_answer = 'None'
+
+ +
+
+required_cols: list[str] = dict_values(['google_places_detailed_website', 'google_places_place_id'])
+
+ +
+
+run() DataFrame[source]
+

Perform the actual processing step. Will not be executed if verify() fails.

+
+
Raises:
+

StepError

+
+
+
+ +
+
+summarize_the_company_website(website, place_id)[source]
+

Summarise client website using GPT. Handles exceptions that mightarise from the API call.

+
+ +
+
+system_message_for_website_summary = "You are html summarizer, you being provided the companies' htmls and you answer with the summary of three to five sentences including all the necessary information which might be useful for salesperson. If no html then just answer with 'None'"
+
+ +
+
+user_message_for_website_summary = 'Give salesperson a summary using following html: {}'
+
+ +
+
+verify() bool[source]
+

Verify that the data has been loaded correctly and is present in a format that can be processed by this step. +If this fails, run() and finish() will not be executed.

+
+ +
+ +
+
+

bdc.steps.hash_generator module

+
+
+class bdc.steps.hash_generator.HashGenerator(force_refresh: bool = False)[source]
+

Bases: Step

+

A pipeline step computing the hashed value of a lead using the basic data that should +be present for every lead. These data include:

+
    +
  • First Name

  • +
  • Last Name

  • +
  • Company / Account

  • +
  • Phone

  • +
  • Email

  • +
+
+
+name
+

Name of this step, used for logging

+
+
Type:
+

str

+
+
+
+ +
+
+added_cols
+

List of fields that will be added to the main dataframe by executing this step

+
+
Type:
+

list[str]

+
+
+
+ +
+
+required_cols
+

List of fields that are required to be existent in the input dataframe before performing this step

+
+
Type:
+

list[str]

+
+
+
+ +
+
+added_cols: list[str] = ['lead_hash']
+
+ +
+
+finish() None[source]
+

Finish the execution. Print a report or clean up temporary files. Will not be executed if verify() fails.

+
+ +
+
+load_data() None[source]
+

Load data for this processing step. This could be an API call or reading from a CSV file. Can also be empty +if self.df is used.

+
+ +
+
+name: str = 'Hash-Generator'
+
+ +
+
+required_cols: list[str] = ['First Name', 'Last Name', 'Company / Account', 'Phone', 'Email']
+
+ +
+
+run() DataFrame[source]
+

Perform the actual processing step. Will not be executed if verify() fails.

+
+
Raises:
+

StepError

+
+
+
+ +
+
+verify() bool[source]
+

Verify that the data has been loaded correctly and is present in a format that can be processed by this step. +If this fails, run() and finish() will not be executed.

+
+ +
+ +
+
+

bdc.steps.preprocess_phonenumbers module

+
+
+class bdc.steps.preprocess_phonenumbers.PreprocessPhonenumbers(force_refresh: bool = False)[source]
+

Bases: Step

+

The PreprocessPhonenumbers step will check if the provided phone numbers are valid and extract geo information +if possible.

+
+
+name
+

Name of this step, used for logging

+
+
Type:
+

str

+
+
+
+ +
+
+added_cols
+

List of fields that will be added to the main dataframe by executing this step

+
+
Type:
+

list[str]

+
+
+
+ +
+
+required_cols
+

List of fields that are required to be existent in the input dataframe before performing this +step

+
+
Type:
+

list[str]

+
+
+
+ +
+
Added Columns:

number_formatted (str): The formatted phone number, e.g. +49 123 456789 +number_country (str): The country of the phone number, e.g. Germany +number_area (str): The area of the phone number, e.g. Berlin +number_valid (bool): Whether the phone number is valid +number_possible (bool): Whether the phone number is possible

+
+
+
+
+added_cols: list[str] = ['number_formatted', 'number_country', 'number_area', 'number_valid', 'number_possible']
+
+ +
+
+check_number(phone_number: str) str | None[source]
+
+ +
+
+finish()[source]
+

Finish the execution. Print a report or clean up temporary files. Will not be executed if verify() fails.

+
+ +
+
+load_data()[source]
+

Load data for this processing step. This could be an API call or reading from a CSV file. Can also be empty +if self.df is used.

+
+ +
+
+name: str = 'Preprocess-Phonenumbers'
+
+ +
+
+process_row(row)[source]
+
+ +
+
+required_cols: list[str] = ['Phone']
+
+ +
+
+run()[source]
+

Perform the actual processing step. Will not be executed if verify() fails.

+
+
Raises:
+

StepError

+
+
+
+ +
+
+verify()[source]
+

Verify that the data has been loaded correctly and is present in a format that can be processed by this step. +If this fails, run() and finish() will not be executed.

+
+ +
+ +
+
+

bdc.steps.regionalatlas module

+
+
+class bdc.steps.regionalatlas.RegionalAtlas(force_refresh: bool = False)[source]
+

Bases: Step

+
+
The RegionalAtlas step will query the RegionalAtlas database for location based geographic and demographic

information, based on the address that was found for a business (currently through Google API) or the +area provided by the phonenumber (preprocess_phonenumbers.py).

+
+
+
+
+name
+

Name of this step, used for logging

+
+
Type:
+

str

+
+
+
+ +
+
+reagionalatlas_feature_keys
+

Dictionary to translate between the keys in the merged.geojson and the used column names in the df

+
+
Type:
+

dict

+
+
+
+ +
+
+df_fields
+

the keys of the merged.geojson

+
+
Type:
+

list[str]

+
+
+
+ +
+
+added_cols
+

List of fields that will be added to the main dataframe by executing this step

+
+
Type:
+

list[str]

+
+
+
+ +
+
+required_cols
+

List of fields that are required in the input dataframe before performing this step

+
+
Type:
+

list[str]

+
+
+
+ +
+
+regions_gdfs
+

dataframe that includes all keys/values from the merged.geojson

+
+ +
+
+empty_result
+

empty result that will be used in case there are problems with the data

+
+
Type:
+

dict

+
+
+
+ +
+
+epsg_code_etrs
+

25832 is the standard used by RegionAtlas

+
+ +
+
Added Columns:

pop_density (float): Population density of the searched city +pop_development (float): Population development of the searched city +age_0 (float): Population age group 0-18 of the searched city +age_1 (float): Population age group 18-30 of the searched city +age_2 (float): Population age group 30-45 of the searched city +age_3 (float): Population age group 45-60 of the searched city +age_4 (float): Population age group 60+ of the searched city +pop_avg_age (float): Average age of the searched city +per_service_sector (float): Percentage of the service sector of the searched city +per_trade (float): Percentage of the trade sector of the searched city +employment_rate (float): Employment rate of the searched city +unemployment_rate (float): Unemployment rate of the searched city +per_long_term_unemployment (float): Percentage of long term unemployment of the searched city +investments_p_employee (float): Investments per employee of the searched city +gross_salary_p_employee (float): Gross salary per employee of the searched city +disp_income_p_inhabitant (float): Disposable income per inhabitant of the searched city +tot_income_p_taxpayer (float): Total income per taxpayer of the searched city +gdp_p_employee (float): GDP per employee of the searched city +gdp_development (float): GDP development of the searched city +gdp_p_inhabitant (float): GDP per inhabitant of the searched city +gdp_p_workhours (float): GDP per workhour of the searched city +pop_avg_age_zensus (float): Average age of the searched city (zensus) +unemployment_rate (float): Unemployment rate of the searched city (zensus) +regional_score (float): Regional score of the searched city

+
+
+
+
+added_cols: list[str] = ['regional_atlas_pop_density', 'regional_atlas_pop_development', 'regional_atlas_age_0', 'regional_atlas_age_1', 'regional_atlas_age_2', 'regional_atlas_age_3', 'regional_atlas_age_4', 'regional_atlas_pop_avg_age', 'regional_atlas_per_service_sector', 'regional_atlas_per_trade', 'regional_atlas_employment_rate', 'regional_atlas_unemployment_rate', 'regional_atlas_per_long_term_unemployment', 'regional_atlas_investments_p_employee', 'regional_atlas_gross_salary_p_employee', 'regional_atlas_disp_income_p_inhabitant', 'regional_atlas_tot_income_p_taxpayer', 'regional_atlas_gdp_p_employee', 'regional_atlas_gdp_development', 'regional_atlas_gdp_p_inhabitant', 'regional_atlas_gdp_p_workhours', 'regional_atlas_pop_avg_age_zensus', 'regional_atlas_regional_score']
+
+ +
+
+calculate_regional_score(lead) float | None[source]
+

Calculate a regional score for a lead based on information from the RegionalAtlas API.

+

This function uses population density, employment rate, and average income to compute +the buying power of potential customers in the area in millions of euro.

+
+
The score is computed as:

(population density * employment rate * average income) / 1,000,000

+
+
+

Possible extensions could include: +- Population age groups

+
+
Parameters:
+

lead – Lead for which to compute the score

+
+
Returns:
+

float | None - The computed score if the necessary fields are present for the lead. None otherwise.

+
+
+
+ +
+
+df_fields: list[str] = dict_values(['ai0201', 'ai0202', 'ai0203', 'ai0204', 'ai0205', 'ai0206', 'ai0207', 'ai0218', 'ai0706', 'ai0707', 'ai0710', 'ai_z08', 'ai0808', 'ai1001', 'ai1002', 'ai1601', 'ai1602', 'ai1701', 'ai1702', 'ai1703', 'ai1704', 'ai_z01'])
+
+ +
+
+empty_result: dict = {'ai0201': None, 'ai0202': None, 'ai0203': None, 'ai0204': None, 'ai0205': None, 'ai0206': None, 'ai0207': None, 'ai0218': None, 'ai0706': None, 'ai0707': None, 'ai0710': None, 'ai0808': None, 'ai1001': None, 'ai1002': None, 'ai1601': None, 'ai1602': None, 'ai1701': None, 'ai1702': None, 'ai1703': None, 'ai1704': None, 'ai_z01': None, 'ai_z08': None}
+
+ +
+
+epsg_code_etrs = 25832
+
+ +
+
+finish() None[source]
+

Finish the execution. Print a report or clean up temporary files. Will not be executed if verify() fails.

+
+ +
+
+get_data_from_address(row)[source]
+

Retrieve the regional features for every lead. Every column of reagionalatlas_feature_keys is added.

+

Based on the google places address or the phonenumber area. Checks if the centroid of the +searched city is in a RegionalAtlas region.

+

Possible extensions could include: +- More RegionalAtlas features

+
+
Parameters:
+

row – Lead for which to retrieve the features

+
+
Returns:
+

dict - The retrieved features if the necessary fields are present for the lead. Empty dictionary otherwise.

+
+
+
+ +
+
+load_data() None[source]
+

Load data for this processing step. This could be an API call or reading from a CSV file. Can also be empty +if self.df is used.

+
+ +
+
+name: str = 'Regional_Atlas'
+
+ +
+
+reagionalatlas_feature_keys: dict = {'age_0': 'ai0203', 'age_1': 'ai0204', 'age_2': 'ai0205', 'age_3': 'ai0206', 'age_4': 'ai0207', 'disp_income_p_inhabitant': 'ai1601', 'employment_rate': 'ai0710', 'gdp_development': 'ai1702', 'gdp_p_employee': 'ai1701', 'gdp_p_inhabitant': 'ai1703', 'gdp_p_workhours': 'ai1704', 'gross_salary_p_employee': 'ai1002', 'investments_p_employee': 'ai1001', 'per_long_term_unemployment': 'ai0808', 'per_service_sector': 'ai0706', 'per_trade': 'ai0707', 'pop_avg_age': 'ai0218', 'pop_avg_age_zensus': 'ai_z01', 'pop_density': 'ai0201', 'pop_development': 'ai0202', 'tot_income_p_taxpayer': 'ai1602', 'unemployment_rate': 'ai_z08'}
+
+ +
+
+regions_gdfs = Empty GeoDataFrame Columns: [] Index: []
+
+ +
+
+required_cols: list[str] = ['google_places_formatted_address']
+
+ +
+
+run() DataFrame[source]
+

Perform the actual processing step. Will not be executed if verify() fails.

+
+
Raises:
+

StepError

+
+
+
+ +
+
+verify() bool[source]
+

Verify that the data has been loaded correctly and is present in a format that can be processed by this step. +If this fails, run() and finish() will not be executed.

+
+ +
+ +
+
+

bdc.steps.search_offeneregister module

+
+
+class bdc.steps.search_offeneregister.SearchOffeneRegister(force_refresh: bool = False)[source]
+

Bases: Step

+

This class represents a step in the sales lead qualification process that searches for company-related data +using the OffeneRegisterAPI.

+
+
+name
+

The name of the step.

+
+
Type:
+

str

+
+
+
+ +
+
+required_cols
+

The list of required columns in the input DataFrame.

+
+
Type:
+

list

+
+
+
+ +
+
+added_cols
+

The list of columns to be added to the input DataFrame.

+
+
Type:
+

list

+
+
+
+ +
+
+offeneregisterAPI
+

An instance of the OffeneRegisterAPI class.

+
+
Type:
+

OffeneRegisterAPI

+
+
+
+ +
+
+verify()[source]
+

Verifies if the step is ready to run.

+
+ +
+
+finish()[source]
+

Performs any necessary cleanup or finalization steps.

+
+ +
+
+load_data()[source]
+

Loads any required data for the step.

+
+ +
+
+run()[source]
+

Executes the step and returns the modified DataFrame.

+
+ +
+ +

Extracts company-related data for a given lead.

+
+ +
+
Added Columns:

company_name (str): The name of the company from offeneregister.de +company_objective (str): The objective of the company offeneregister.de +company_capital (float): The capital of the company offeneregister.de +company_capital_currency (str): The currency of the company capital offeneregister.de +company_address (str): The address of the company offeneregister.de

+
+
+
+
+added_cols: list[str] = ['company_name', 'company_objective', 'company_capital', 'company_capital_currency', 'compan_address']
+
+ +
+
+finish()[source]
+

Finish the execution. Print a report or clean up temporary files. Will not be executed if verify() fails.

+
+ +
+
+load_data()[source]
+

Load data for this processing step. This could be an API call or reading from a CSV file. Can also be empty +if self.df is used.

+
+ +
+
+name: str = 'OffeneRegister'
+
+ +
+
+offeneregisterAPI = <bdc.steps.helpers.offeneregister_api.OffeneRegisterAPI object>
+
+ +
+
+required_cols: list[str] = ['Last Name', 'First Name']
+
+ +
+
+run() DataFrame[source]
+

Perform the actual processing step. Will not be executed if verify() fails.

+
+
Raises:
+

StepError

+
+
+
+ +
+
+verify() bool[source]
+

Verify that the data has been loaded correctly and is present in a format that can be processed by this step. +If this fails, run() and finish() will not be executed.

+
+ +
+ +
+
+

bdc.steps.step module

+
+
+class bdc.steps.step.Step(force_refresh: bool = False)[source]
+

Bases: object

+

Step is an abstract parent class for all steps of the data enrichment pipeline. Steps can be added to a list +and then be passed to the pipeline for sequential execution.

+
+
+name
+

Name of this step, used for logging and as column prefix

+
+
Type:
+

str

+
+
+
+ +
+
+added_cols
+

List of fields that will be added to the main dataframe by executing a step

+
+
Type:
+

list[str]

+
+
+
+ +
+
+required_cols
+

List of fields that are required to be existent in the input dataframe before performing a step

+
+
Type:
+

list[str]

+
+
+
+ +
+
+added_cols: list[str] = []
+
+ +
+
+check_data_presence() bool[source]
+

Check whether the data this step collects is already present in the df. +Can be forced to return False if self._force_execution is set to True.

+
+ +
+
+property df: DataFrame
+
+ +
+
+finish() None[source]
+

Finish the execution. Print a report or clean up temporary files. Will not be executed if verify() fails.

+
+ +
+
+load_data() None[source]
+

Load data for this processing step. This could be an API call or reading from a CSV file. Can also be empty +if self.df is used.

+
+ +
+
+name: str = None
+
+ +
+
+required_cols: list[str] = []
+
+ +
+
+run() DataFrame[source]
+

Perform the actual processing step. Will not be executed if verify() fails.

+
+
Raises:
+

StepError

+
+
+
+ +
+
+verify() bool[source]
+

Verify that the data has been loaded correctly and is present in a format that can be processed by this step. +If this fails, run() and finish() will not be executed.

+
+ +
+ +
+
+exception bdc.steps.step.StepError[source]
+

Bases: Exception

+
+ +
+
+

Module contents

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/config.html b/config.html new file mode 100644 index 0000000..e39f7e5 --- /dev/null +++ b/config.html @@ -0,0 +1,128 @@ + + + + + + + config module — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

config module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/database.html b/database.html new file mode 100644 index 0000000..72a229d --- /dev/null +++ b/database.html @@ -0,0 +1,264 @@ + + + + + + + database package — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

database package

+
+

Subpackages

+
+ +
+
+
+

Module contents

+
+
+database.get_database() Repository[source]
+
+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/database.leads.html b/database.leads.html new file mode 100644 index 0000000..1862873 --- /dev/null +++ b/database.leads.html @@ -0,0 +1,811 @@ + + + + + + + database.leads package — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

database.leads package

+
+

Submodules

+
+
+

database.leads.local_repository module

+
+
+class database.leads.local_repository.LocalRepository[source]
+

Bases: Repository

+
+
+BASE_PATH = '/home/runner/work/amos2023ws06-sales-lead-qualifier/amos2023ws06-sales-lead-qualifier/src/database/leads'
+
+ +
+
+CLASSIFICATION_REPORTS = '/home/runner/work/amos2023ws06-sales-lead-qualifier/amos2023ws06-sales-lead-qualifier/src/data/classification_reports'
+
+ +
+
+DF_HISTORICAL_OUTPUT = '/home/runner/work/amos2023ws06-sales-lead-qualifier/amos2023ws06-sales-lead-qualifier/src/data/100k_historic_enriched.csv'
+
+ +
+
+DF_INPUT = '/home/runner/work/amos2023ws06-sales-lead-qualifier/amos2023ws06-sales-lead-qualifier/src/data/sumup_leads_email.csv'
+
+ +
+
+DF_OUTPUT = '/home/runner/work/amos2023ws06-sales-lead-qualifier/amos2023ws06-sales-lead-qualifier/src/data/leads_enriched.csv'
+
+ +
+
+DF_PREDICTION_OUTPUT = '/home/runner/work/amos2023ws06-sales-lead-qualifier/amos2023ws06-sales-lead-qualifier/src/data/leads_predicted_size.csv'
+
+ +
+
+DF_PREPROCESSED_INPUT = '/home/runner/work/amos2023ws06-sales-lead-qualifier/amos2023ws06-sales-lead-qualifier/src/data/preprocessed_data_files'
+
+ +
+
+GPT_RESULTS = '/home/runner/work/amos2023ws06-sales-lead-qualifier/amos2023ws06-sales-lead-qualifier/src/data/gpt-results'
+
+ +
+
+ML_MODELS = '/home/runner/work/amos2023ws06-sales-lead-qualifier/amos2023ws06-sales-lead-qualifier/src/data/models'
+
+ +
+
+REVIEWS = '/home/runner/work/amos2023ws06-sales-lead-qualifier/amos2023ws06-sales-lead-qualifier/src/data/reviews'
+
+ +
+
+SNAPSHOTS = '/home/runner/work/amos2023ws06-sales-lead-qualifier/amos2023ws06-sales-lead-qualifier/src/data/snapshots'
+
+ +
+
+clean_snapshots(prefix)[source]
+

Clean up the snapshots after a pipeline ran successfully +:param prefix: Prefix of the current pipeline run used to identify all snapshots to delete

+
+ +
+
+create_snapshot(df, prefix, name)[source]
+

Snapshot the current state of the dataframe +:param df: Data to create a snapshot of +:param prefix: Prefix for a group of snapshots belonging to a singe pipeline run, used to identify snapshots +when cleaning up after a pipeline run +:param name: Name of the snapshot +:return: None

+
+ +
+
+fetch_gpt_result(file_id, operation_name)[source]
+

Fetches the GPT result for a given file ID and operation name.

+
+
Parameters:
+
    +
  • file_id (str) – The ID of the file.

  • +
  • operation_name (str) – The name of the GPT operation.

  • +
+
+
Returns:
+

The GPT result for the specified file ID and operation name.

+
+
+
+ +
+
+fetch_review(place_id)[source]
+

Fetch review for specified place_id +:return: json contents of desired review

+
+ +
+
+get_preprocessed_data_path(historical: bool = True)[source]
+

Returns the path for a preprocessed data file (either historical or current)

+
+ +
+
+insert_data(data)[source]
+

TODO: Insert new data into specified dataframe +:param data: Data to be inserted (desired format must be checked)

+
+ +
+
+load_classification_report(model_name: str)[source]
+

Load a given classification report to a file with a given name

+
+
Parameters:
+

model_name (str) – Model name that created the report

+
+
+
+ +
+
+load_lookup_table(step_name: str) dict[source]
+

Create or load the lookup table of hashes for a given step +:return: lookup table as a pandas DataFrame

+
+ +
+
+load_ml_model(model_name: str)[source]
+

Load a ML model from a file with a given name

+
+
Parameters:
+

model_name (str) – File name

+
+
+
+ +
+
+load_preprocessed_data(historical: bool = True)[source]
+

Load the preprocessed data from the given file

+
+ +
+
+save_classification_report(report, model_name: str)[source]
+

Save a given classification report to a file with a given name

+
+
Parameters:
+
    +
  • report – The classification report to save

  • +
  • model_name (str) – Model name that created the report

  • +
+
+
+
+ +
+
+save_dataframe()[source]
+

Save dataframe in df attribute in chosen output location

+
+ +
+
+save_gpt_result(gpt_result, file_id, operation_name, force_refresh=False)[source]
+

Save the results of GPT operations to a specified path +:param gpt_results: The results of the GPT operations to be saved +:param operation_name: The name of the GPT operation +:param save_date: The date the results were saved

+
+ +
+
+save_lookup_table(lookup_table: dict, step_name: str) None[source]
+

Save the lookup table for hashes for a given step

+
+ +
+
+save_ml_model(model, model_name: str)[source]
+

Save a given ML model to a file with a given name

+
+
Parameters:
+
    +
  • model – Model to save

  • +
  • model_name (str) – File name

  • +
+
+
+
+ +
+
+save_prediction(df)[source]
+

Save dataframe in df parameter in chosen output location

+
+ +
+
+save_review(review, place_id, force_refresh=False)[source]
+

Upload review to specified review path +:param review: json contents of the review to be uploaded

+
+ +
+ +
+
+

database.leads.repository module

+
+
+class database.leads.repository.Repository[source]
+

Bases: ABC

+
+
+DATETIME_FORMAT = '%Y-%m-%d %H:%M:%S'
+
+ +
+
+abstract property DF_HISTORICAL_OUTPUT
+

Define database path to store historical enriched dataframe (used for preprocessing input)

+
+ +
+
+abstract property DF_INPUT
+

Define database path to load dataframe

+
+ +
+
+abstract property DF_OUTPUT
+

Define database path to store dataframe

+
+ +
+
+abstract property GPT_RESULTS
+

Define database path to store GPT operations

+
+ +
+
+abstract property REVIEWS
+

Define database path to store reviews

+
+ +
+
+abstract property SNAPSHOTS
+

Define database path to store snapshots

+
+ +
+
+abstract clean_snapshots(prefix)[source]
+

Clean up the snapshots after a pipeline ran successfully +:param prefix: Prefix of the current pipeline run used to identify all snapshots to delete

+
+ +
+
+abstract create_snapshot(df, prefix, name)[source]
+

Snapshot the current state of the dataframe +:param df: Data to create a snapshot of +:param prefix: Prefix for a group of snapshots belonging to a singe pipeline run, used to identify snapshots +when cleaning up after a pipeline run +:param name: Name of the snapshot +:return: None

+
+ +
+
+abstract fetch_gpt_result(file_id, operation_name)[source]
+

Fetches the GPT result for a given file ID and operation name.

+
+
Parameters:
+
    +
  • file_id (str) – The ID of the file.

  • +
  • operation_name (str) – The name of the GPT operation.

  • +
+
+
Returns:
+

The GPT result for the specified file ID and operation name.

+
+
+
+ +
+
+abstract fetch_review(place_id)[source]
+

Fetch review for specified place_id +:return: json contents of desired review

+
+ +
+
+get_dataframe()[source]
+
+ +
+
+get_enriched_data_path(historical=False)[source]
+
+ +
+
+get_input_path()[source]
+
+ +
+
+abstract get_preprocessed_data_path(historical: bool = True)[source]
+

Returns the path for a preprocessed data file (either historical or current)

+
+ +
+
+abstract insert_data(data)[source]
+

Insert new data into specified dataframe +:param data: Data to be inserted (desired format must be checked)

+
+ +
+
+abstract load_classification_report(model_name: str)[source]
+

Load a given classification report to a file with a given name

+
+
Parameters:
+

model_name (str) – Model name that created the report

+
+
+
+ +
+
+abstract load_lookup_table(step_name: str) dict[source]
+

Create or load the lookup table of hashes for a given step +:return: lookup table as a pandas DataFrame

+
+ +
+
+abstract load_ml_model(model_name: str)[source]
+

Load a ML model from a file with a given name

+
+
Parameters:
+

model_name (str) – File name

+
+
+
+ +
+
+abstract load_preprocessed_data(historical: bool = True)[source]
+

Load the preprocessed data from the given file

+
+ +
+
+abstract save_classification_report(report, model_name: str)[source]
+

Save a given classification report to a file with a given name

+
+
Parameters:
+
    +
  • report – The classification report to save

  • +
  • model_name (str) – Model name that created the report

  • +
+
+
+
+ +
+
+abstract save_dataframe()[source]
+

Save dataframe in df attribute in chosen output location

+
+ +
+
+abstract save_gpt_result(gpt_result, file_id, operation_name, force_refresh=False)[source]
+

Saves the GPT result for a given file ID and operation name.

+
+
Parameters:
+
    +
  • gpt_result (str) – The GPT result to be saved.

  • +
  • file_id (str) – The ID of the file.

  • +
  • operation_name (str) – The name of the operation.

  • +
  • force_refresh (bool, optional) – Whether to force a refresh of the saved result. Defaults to False.

  • +
+
+
+
+ +
+
+abstract save_lookup_table(lookup_table: dict, step_name: str) None[source]
+

Save the lookup table for hashes for a given step

+
+ +
+
+abstract save_ml_model(model, model_name: str)[source]
+

Save a given ML model to a file with a given name

+
+
Parameters:
+
    +
  • model – Model to save

  • +
  • model_name (str) – File name

  • +
+
+
+
+ +
+
+abstract save_prediction(df)[source]
+

Save dataframe in df parameter in chosen output location

+
+ +
+
+abstract save_review(review, place_id, force_refresh=False)[source]
+

Upload review to specified review path +:param review: json contents of the review to be uploaded

+
+ +
+
+set_dataframe(df)[source]
+
+ +
+ +
+
+

database.leads.s3_repository module

+
+
+class database.leads.s3_repository.S3Repository[source]
+

Bases: Repository

+
+
+CLASSIFICATION_REPORTS = 's3://amos--models/classification_reports/'
+
+ +
+
+DF_HISTORICAL_OUTPUT = 's3://amos--data--events/historical_data/100k_historic_enriched.csv'
+
+ +
+
+DF_INPUT = 's3://amos--data--events/leads/enriched.csv'
+
+ +
+
+DF_OUTPUT = 's3://amos--data--events/leads/enriched.csv'
+
+ +
+
+DF_PREDICTION_OUTPUT = 's3://amos--data--events/leads/leads_predicted_size.csv'
+
+ +
+
+DF_PREPROCESSED_INPUT = 's3://amos--data--features/preprocessed_data_files/'
+
+ +
+
+EVENTS_BUCKET = 'amos--data--events'
+
+ +
+
+FEATURES_BUCKET = 'amos--data--features'
+
+ +
+
+GPT_RESULTS = 's3://amos--data--events/gpt-results/'
+
+ +
+
+LOOKUP_TABLES = 's3://amos--data--events/lookup_tables/'
+
+ +
+
+ML_MODELS = 's3://amos--models/models/'
+
+ +
+
+MODELS_BUCKET = 'amos--models'
+
+ +
+
+REVIEWS = 's3://amos--data--events/reviews/'
+
+ +
+
+SNAPSHOTS = 's3://amos--data--events/snapshots/'
+
+ +
+
+clean_snapshots(prefix)[source]
+

Clean up the snapshots after a pipeline ran successfully +:param prefix: Prefix of the current pipeline run used to identify all snapshots to delete

+
+ +
+
+create_snapshot(df, prefix, name)[source]
+

Snapshot the current state of the dataframe +:param df: Data to create a snapshot of +:param prefix: Prefix for a group of snapshots belonging to a singe pipeline run, used to identify snapshots +when cleaning up after a pipeline run +:param name: Name of the snapshot +:return: None

+
+ +
+
+fetch_gpt_result(file_id, operation_name)[source]
+

Fetches the GPT result for a given file ID and operation name from S3

+
+ +
+
+fetch_review(place_id)[source]
+

Fetch review for specified place_id +:return: json contents of desired review

+
+ +
+
+get_preprocessed_data_path(historical: bool = True)[source]
+

Returns the path for a preprocessed data file (either historical or current)

+
+ +
+
+insert_data(data)[source]
+

TODO: Insert new data into specified dataframe +:param data: Data to be inserted (desired format must be checked)

+
+ +
+
+load_classification_report(model_name: str)[source]
+

Load a given classification report to a file with a given name

+
+
Parameters:
+

model_name (str) – Model name that created the report

+
+
+
+ +
+
+load_lookup_table(step_name: str) dict[source]
+

Create or load the lookup table of hashes for a given step +:return: lookup table as a pandas DataFrame

+
+ +
+
+load_ml_model(model_name: str)[source]
+

Load a ML model from a file with a given name

+
+
Parameters:
+

model_name (str) – File name

+
+
+
+ +
+
+load_preprocessed_data(historical: bool = True)[source]
+

Load the preprocessed data from the given file

+
+ +
+
+save_classification_report(report, model_name: str)[source]
+

Save a given classification report to a file with a given name

+
+
Parameters:
+
    +
  • report – The classification report to save

  • +
  • model_name (str) – Model name that created the report

  • +
+
+
+
+ +
+
+save_dataframe()[source]
+

Save dataframe in df attribute in chosen output location

+
+ +
+
+save_gpt_result(gpt_result, file_id, operation_name, force_refresh=False)[source]
+

Saves the GPT result for a given file ID and operation name on S3

+
+ +
+
+save_lookup_table(lookup_table: dict, step_name: str) None[source]
+

Save the lookup table for hashes for a given step

+
+ +
+
+save_ml_model(model, model_name: str)[source]
+

Save a given ML model to a file with a given name

+
+
Parameters:
+
    +
  • model – Model to save

  • +
  • model_name (str) – File name

  • +
+
+
+
+ +
+
+save_prediction(df)[source]
+

Save dataframe in df parameter in chosen output location

+
+ +
+
+save_review(review, place_id, force_refresh=False)[source]
+

Upload review to specified review path +:param review: json contents of the review to be uploaded

+
+ +
+ +
+
+database.leads.s3_repository.decode_s3_url(url)[source]
+

Retrieve the bucket and object key from object url +:return: bucket string, object key string

+
+ +
+
+

Module contents

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/demo.html b/demo.html new file mode 100644 index 0000000..20b2058 --- /dev/null +++ b/demo.html @@ -0,0 +1,372 @@ + + + + + + + demo package — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

demo package

+
+

Submodules

+
+
+

demo.console_utils module

+
+
+demo.console_utils.get_int_input(prompt: str, input_range: range | None = None) int[source]
+

Prompts the user for an integer input and validates it.

+
+
Parameters:
+
    +
  • prompt (str) – The prompt message to display to the user.

  • +
  • input_range (range, optional) – The range of valid input values. Defaults to None.

  • +
+
+
Returns:
+

The validated integer input.

+
+
Return type:
+

int

+
+
Raises:
+

ValueError – If the input is not a valid integer.

+
+
+
+ +
+
+demo.console_utils.get_multiple_choice(prompt: str, choices: list) str[source]
+

Prompts the user with a message and a list of choices, and returns the selected choice.

+
+
Parameters:
+
    +
  • prompt (str) – The message to display to the user.

  • +
  • choices (list) – The list of choices to display to the user.

  • +
+
+
Returns:
+

The selected choice.

+
+
Return type:
+

str

+
+
Raises:
+

ValueError – If the user enters an invalid input.

+
+
+
+ +
+
+demo.console_utils.get_string_input(prompt: str) str[source]
+

Prompts the user with a given prompt and returns a non-empty string. +The input is case-sensitive and will be stripped from spaces.

+
+
Parameters:
+

prompt (str) – The prompt to display to the user.

+
+
Returns:
+

Entered non-empty, stripped string

+
+
Return type:
+

str

+
+
+
+ +
+
+demo.console_utils.get_yes_no_input(prompt: str) bool[source]
+

Prompts the user with a given prompt and returns True if the user enters ‘yes’ or ‘y’, +and False if the user enters ‘no’ or ‘n’. The input is case-insensitive.

+
+
Parameters:
+

prompt (str) – The prompt to display to the user.

+
+
Returns:
+

True if the user enters ‘yes’ or ‘y’, False if the user enters ‘no’ or ‘n’.

+
+
Return type:
+

bool

+
+
+
+ +
+
+

demo.demos module

+
+
+demo.demos.add_step_if_requested(steps, step_class, step_desc, step_warning_message: str = '')[source]
+
+ +
+
+demo.demos.evp_demo()[source]
+
+ +
+
+demo.demos.pipeline_demo()[source]
+

Demonstrates the execution of a pipeline.

+

The function prompts the user to select a pipeline configuration or create a custom one. +It then sets a limit for the number of data points to be processed, if specified. +Finally, it runs the pipeline with the selected configuration and limit.

+
+
Parameters:
+

None

+
+
Returns:
+

None

+
+
+
+ +
+
+demo.demos.predict_MerchantSize_on_lead_data_demo()[source]
+
+ +
+
+demo.demos.predict_single_lead(evp: EstimatedValuePredictor)[source]
+
+ +
+
+demo.demos.preprocessing_demo()[source]
+
+ +
+
+demo.demos.test_evp_model(evp: EstimatedValuePredictor)[source]
+
+ +
+
+

demo.pipeline_utils module

+
+
+demo.pipeline_utils.get_all_available_pipeline_json_configs(config_path: str = '/home/runner/work/amos2023ws06-sales-lead-qualifier/amos2023ws06-sales-lead-qualifier/src/demo/pipeline_configs/') list[source]
+

Returns a list of all available pipeline json configs in the given path. +:param config_path: Path to the pipeline json configs +:return: List of all available pipeline json configs

+
+ +
+
+demo.pipeline_utils.get_pipeline_additional_steps() list[source]
+

Returns a copy of the additional pipeline steps.

+
+
Returns:
+

A copy of the additional pipeline steps.

+
+
Return type:
+

list

+
+
+
+ +
+
+demo.pipeline_utils.get_pipeline_config_from_json(config_name: str, config_path: str = '/home/runner/work/amos2023ws06-sales-lead-qualifier/amos2023ws06-sales-lead-qualifier/src/demo/pipeline_configs/') list[source]
+

Retrieves the pipeline configuration from a JSON file.

+
+
Parameters:
+
    +
  • config_name (str) – The name of the configuration file.

  • +
  • config_path (str, optional) – The path to the configuration file. Defaults to DEFAULT_PIPELINE_PATH.

  • +
+
+
Returns:
+

A list of pipeline steps.

+
+
Return type:
+

list

+
+
+
+ +
+
+demo.pipeline_utils.get_pipeline_initial_steps() list[source]
+

Returns a copy of the initial pipeline steps.

+
+
Returns:
+

A copy of the initial pipeline steps.

+
+
Return type:
+

list

+
+
+
+ +
+
+demo.pipeline_utils.get_pipeline_steps() list[source]
+

Returns a copy of the pipeline steps, which includes both the initial pipeline steps +and the additional pipeline steps.

+
+
Returns:
+

A copy of the pipeline steps.

+
+
Return type:
+

list

+
+
+
+ +
+
+

Module contents

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/documentation.html b/documentation.html new file mode 100644 index 0000000..cb36045 --- /dev/null +++ b/documentation.html @@ -0,0 +1,2050 @@ + + + + + + + Build Documentation — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

Build Documentation

+ +
+

Creating the Environment

+

The repository contains the file .env.template. This file is a template for +the environment variables that need to be set for the application to run. Copy +this file into a file called .env at the root level of this repository and +fill in all values with the corresponding secrets.

+

To create the virtual environment in this project you must have pipenv +installed on your machine. Then run the following commands:

+
# for development environment
+pipenv install --dev
+# for production environment
+pipenv install
+
+
+

To work within the environment you can now run:

+
# to activate the virtual environment
+pipenv shell
+# to run a single command
+pipenv run <COMMAND>
+
+
+
+
+

Build Process

+

This application is built and tested on every push and pull request creation +through Github actions. For this, the pipenv environment is installed and then +the code style is checked using flake8. Finally, the tests/ directory is +executed using pytest and a test coverage report is created using coverage. +The test coverage report can be found in the Github actions output.

+

In another task, all used packages are tested for their license to ensure that +the software does not use any copy-left licenses and remains open source and +free to use.

+

If any of these steps fail for a pull request the pull request is blocked from +being merged until the corresponding step is fixed.

+

Furthermore, it is required to install the pre-commit hooks as described +here. +This ensures uniform coding style throughout the project as well as that the +software is compliant with the REUSE licensing specifications.

+
+
+

Running the app

+

To run the application the pipenv environment must be installed and all needed +environment variables must be set in the .env file. Then the application can +be started via

+
pipenv run python src/main.py
+
+
+
+
+
+

User Documentation

+ +
+

Project vision

+

This product will give our industry partner a tool at hand, that can effectively +increase conversion of their leads to customers, primarily by providing the +sales team with valuable information. The modular architecture makes our product +future-proof, by making it easy to add further data sources, employ improved +prediction models or to adjust the output format if desired.

+
+
+

Project mission

+

The mission of this project is to enrich historical data about customers and +recent data about leads (with information from external sources) and to leverage +the enriched data in machine learning, so that the estimated Merchant Size of +leads can be predicted.

+
+
+

Usage

+

To execute the final program, ensure the environment is installed (refer to +build-documents.md) and run python .\src\main.py either locally or via the +build process. The user will be presented with the following options:

+
Choose demo:
+(0) : Base Data Collector
+(1) : Data preprocessing
+(2) : ML model training
+(3) : Merchant Size Predictor
+(4) : Exit
+
+
+
+

(0) : Base Data Collector

+

This is the data enrichment pipeline, utilizing multiple data enrichment steps. +Configuration options are presented:

+

Do you want to list all available pipeline configs? (y/N) If y:

+
Please enter the index of requested pipeline config:
+(0) : config_sprint09_release.json
+(1) : just_run_search_offeneregister.json
+(2) : run_all_steps.json
+(3) : Exit
+
+
+
    +
  • (0) Coniguration used in sprint 9.

  • +
  • (1) Coniguration for OffeneRegister.

  • +
  • (2) Running all the steps of the pipeline without steps selection.

  • +
  • (3) Exit to the pipeline step selection.

  • +
+

If n: proceed to pipeline step selection for data enrichment. Subsequent +questions arise:

+
Run Scrape Address (will take a long time)(y/N)?
+Run Search OffeneRegister (will take a long time)(y/N)?
+Run Phone Number Validation (y/N)?
+Run Google API (will use token and generate cost!)(y/N)?
+Run Google API Detailed (will use token and generate cost!)(y/N)?
+Run openAI GPT Sentiment Analyzer (will use token and generate cost!)(y/N)?
+Run openAI GPT Summarizer (will use token and generate cost!)(y/N)?
+Run Smart Review Insights (will take looong time!)(y/N)?
+Run Regionalatlas (y/N)?
+
+
+
    +
  • Run Scrape Address (will take a long time)(y/N)?: This enrichment step +scrapes the leads website for an address using regex.

  • +
  • Run Search OffeneRegister (will take a long time)(y/N)?: This enrichment +step searches for company-related data using the OffeneRegisterAPI.

  • +
  • Run Phone Number Validation (y/N)?: This enrichment step checks if the +provided phone numbers are valid and extract geographical information using +geocoder.

  • +
  • Run Google API (will use token and generate cost!)(y/N)?: This enrichment +step tries to the correct business entry in the Google Maps database. It will +save basic information along with the place id, that can be used to retrieve +further detailed information and a confidence score that should indicate the +confidence in having found the correct result.

  • +
  • Run Google API Detailed (will use token and generate cost!)(y/N)?: This +enrichment step tries to gather detailed information for a given google +business entry, identified by the place ID.

  • +
  • Run openAI GPT Sentiment Analyzer (will use token and generate cost!)(y/N)?: +This enrichment step performs sentiment analysis on reviews using GPT-4 model.

  • +
  • Run openAI GPT Summarizer (will use token and generate cost!)(y/N)?: This +enrichment step attempts to download a businesses website in raw html format +and pass this information to OpenAIs GPT, which will then attempt to summarize +the raw contents and extract valuable information for a salesperson.

  • +
  • Run Smart Review Insights (will take looong time!)(y/N)?: This enrichment +step enhances review insights for smart review analysis

  • +
  • Run Regionalatlas (y/N)?: This enrichment step will query the RegionalAtlas +database for location based geographic and demographic information, based on +the address that was found for a business through Google API.

  • +
+

It is emphasized that some steps are dependent on others, and excluding one +might result in dependency issues for subsequent steps.

+

After selecting the desired enrichtment steps, a prompt asks the user to +Set limit for data points to be processed (0=No limit) such that the user +chooses whether it apply the data enrichment steps for all the leads (no limit) +or for a certain number of leads.

+

Note: In case DATABASE_TYPE="S3" in your .env file, the limit will be +removed, in order to enrich all the data into s3://amos--data--events S3 +bucket.

+
+
+

(1) : Data preprocessing

+

Post data enrichment, preprocessing is crucial for machine learning models, +involving scaling, numerical outlier removal, and categorical one-hot encoding. +The user is prompted with questions:

+

Filter out the API-irrelevant data? (y/n): This will filter out all the leads +that couldn’t be enriched during the data enrichtment steps, removing them would +be useful for the Machine Learning algorithms, to avoid any bias introduced, +even if we pad the features with zeros. +Run on historical data ? (y/n) Note: DATABASE_TYPE should be S3!: The user has +to have DATABASE_TYPE="S3" in .env file in order to run on historical data, +otherwise, it will run locally. After preprocessing, the log will show where the +preprocessed_data is stored.

+
+
+

(2) : ML model training

+

Six machine learning models are available:

+
(0) : Random Forest
+(1) : XGBoost
+(2) : Naive Bayes
+(3) : KNN Classifier
+(4) : AdaBoost
+(5) : LightGBM
+
+
+

After selection of the desired machine learning model, the user would be +prompted with a series of questions:

+
    +
  • Load model from file? (y/N) : In case of y, the program will ask for a +file location of a previously saved model to use for predictions and testing.

  • +
  • Use 3 classes ({XS}, {S, M, L}, {XL}) instead of 5 classes ({XS}, {S}, {M}, {L}, {XL})? (y/N): +In case of y, the S, M, L labels of the data would be grouped alltogether as +one class such that the training would be on 3 classes ({XS}, {S, M, L}, {XL}) +instead of the 5 classes. It is worth noting that grouping the S, M and L +classes alltogether as one class resulted in boosting the classification +performance.

  • +
  • Do you want to train on a subset of features?
    +(0) : ['Include all features']
    +(1) : ['google_places_rating', 'google_places_user_ratings_total', 'google_places_confidence', 'regional_atlas_regional_score']
    +
    +
    +
  • +
+

0 would include all the numerical and categorical one-hot encoded features, +while 1 would choose a small subset of data as features for the machine +learning models

+

Then, the user would be given multiple options:

+
(1) Train
+(2) Test
+(3) Predict on single lead
+(4) Save model
+(5) Exit
+
+
+
    +
  • (1): Train the current model on the current trainig dataset.

  • +
  • (2): Test the current model on the test dataset, displaying the mean squared +error.

  • +
  • (3): Choose a single lead from the test dataset and display the prediction and +true label.

  • +
  • (4): Save the current model to the amos--models/models on S3 in case of +DATABASE_TYPE=S3, otherwise it will save it locally.

  • +
  • (5): Exit the EVP submenu

  • +
+
+
+

(3) : Merchant Size Predictor

+

After training, testing, and saving the model, the true essence of models lies +not just in crucial task of generating forecasted predictions for previously +unseen leads.

+
+
+

(4) : Exit

+

Gracefully exit the program.

+
+
+
+
+

Design Documentation

+ +
+

Introduction

+

This application serves as a pivotal tool employed by our esteemed industry +partner, SumUp, for the enrichment of information pertaining to potential leads +garnered through their sign-up website. The refined data obtained undergoes +utilization in the prediction of potential value that a lead could contribute to +SumUp, facilitated by a sophisticated machine learning model. The application is +branched into two integral components: the Base Data Collector (BDC) and the +Merchant Size Predictor (MSP).

+
+

Component Diagram

+

Component Diagram

+
+
+

External Software

+
+

Lead Form (LF)

+

The Lead Form is submitted by every new lead and provides a small set of data +about the lead.

+
+
+

Customer Relationship Management (CRM)

+

The project output is made available to the sales team. This can be done in +different ways, e.g. writing to a Google Sheet or pushing directly to +SalesForce.

+
+
+
+

Components

+
+
+

Base Data Collector (BDC)

+
+

General description

+

The Base Data Collector (BDC) plays a crucial role in enriching the dataset +related to potential client leads. The initial dataset solely comprises +fundamental lead information, encompassing the lead’s first and last name, phone +number, email address, and company name. Recognizing the insufficiency of this +baseline data for value prediction, the BDC is designed to query diverse data +sources, incorporating various Application Programming Interfaces (APIs), to +enrich the provided lead data.

+
+
+

Design

+

The different data sources are organised as steps in the program. Each step +extends from a common parent class and implements methods to validate that it +can run, perform the data collection from the source and perform clean up and +statistics reports for itself. These steps are then collected in a pipeline +object sequentially performing the steps to enhance the given data with all +chosen data sources. The data sources include:

+
    +
  • inspecting the possible custom domain of the email address.

  • +
  • retrieving multiple data from the Google Places API.

  • +
  • analysing the sentiment of Google reviews using GPT.

  • +
  • inspecting the surrounding areas of the business using the Regional Atlas API.

  • +
  • searching for company-related data using the OffeneRegisterAPI.

  • +
  • performing sentiment analysis on reviews using GPT-4 model.

  • +
+
+
+

Data storage

+

All data for this project is stored in CSV files in the client’s AWS S3 storage. +The files here are split into three buckets. The input data and enhanced data +are stored in the events bucket, pre-processed data ready for use of ML models +is stored in the features bucket and the used model and inference is stored in +the model bucket. Data preprocessing Following data enrichment, a pivotal phase +in the machine learning pipeline is data preprocessing, an essential process +encompassing scaling operations, numerical outlier elimination, and categorical +one-hot encoding. This preprocessing stage serves transforms the output +originating from the BDC into feature vectors, thereby rendering them amenable +for predictive analysis by the machine learning model.

+
+
+
+

Merchant Size Predictor (MSP) / Estimated Value Predictor (EVP)

+
+

Historical Note

+

The primary objective of the Estimated Value Predictor was initially oriented +towards forecasting the estimated life-time value of leads. However, this +objective evolved during the project’s progression, primarily influenced by +labelling considerations. The main objective has therefore changed to predicting +only the size of a given lead, which can then be used as an indication for their +potential life-time value. As a consequence, the component in questions is now +(somewhat inconsistently) either referred to as the Estimated Value Predictor +(EVP) or as the Merchant Size Predictor (MSP).

+
+
+

Design

+

In the context of Merchant Size Prediction, our aim is to leverage pre-trained +ML models on new lead data. By applying these models, we intend to predict the +potential Merchant Size, thereby assisting SumUp in prioritizing leads and +making informed decisions on which leads to contact first. This predictive +approach enhances the efficiency of lead management and optimizes resource +allocation for maximum impact.

+

The machine learning model, integral to the MSP, undergoes training on +proprietary historical data sourced from SumUp. The training process aims to +discern discriminative features that effectively stratify each class within the +Merchant Size taxonomy. It is imperative to note that the confidentiality of the +underlying data prohibits its public disclosure.

+
+
+
+
+

Data Fields

+ +
+

Data Field Definitions

+

This document outlines the data fields obtained for each lead. The data can be +sourced from the online Lead Form or be retrieved from the internet using +APIs.

+
+

Data Field Table

+

The most recent Data Fields table can now be found in a +separate CSV File.

+
+ +
+
+
+

Data Fields CSV

+

The following table highlights the data fields obtained for each lead. +The acquisition of such data may derive from the Lead Form or may be extracted from external sources utilizing APIs.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Data Field Definition

Field Name

Type

Description

Data source

Dependencies

Example

Last Name

string

Last name of the lead

Lead data

    +
  • +
+

Mustermann

First Name

string

First name of the lead

Lead data

    +
  • +
+

Mustername

Company / Account

string

Company name of the lead

Lead data

    +
  • +
+

Mustercompany

Phone

string

Phone number of the lead

Lead data

    +
  • +
+

49 1234 56789

Email

string

Email of the lead

Lead data

    +
  • +
+

musteremail@example.com

domain

string

The domain of the email is the part that follows the “@” symbol, indicating the organization or service hosting the email address.

processing

Email

example.com

email_valid

boolean

Checks if the email is valid.

email_validator package

Email

True/False

first_name_in_account

boolean

Checks if first name is written in “Account” input

processing

First Name

True/False

last_name_in_account

boolean

Checks if last name is written in “Account” input

processing

Last Name

True/False

number_formatted

string

Phone number (formatted)

phonenumbers package

Phone

49123456789

number_country

string

Country derived from phone number

phonenumbers package

Phone

Germany

number_area

string

Area derived from phone number

phonenumbers package

Phone

Erlangen

number_valid

boolean

Indicator weather a phone number is valid

phonenumbers package

Phone

True/False

number_possible

boolean

Indicator weather a phone number is possible

phonenumbers package

Phone

True/False

google_places_place_id

string

Place ID used by Google

Google Places API

Company / Account

    +
  • +
+

google_places_business_status

string

Business Status

Google Places API

Company / Account

Operational

google_places_formatted_address

string

Formatted address

Google Places API

Company / Account

Musterstr.1

google_places_name

string

Business Name

Google Places API

Company / Account

Mustername

google_places_user_ratings_total

integer

Total number of ratings

Google Places API

Company / Account

100

google_places_rating

float

Average star rating

Google Places API

Company / Account

4.5

google_places_price_level

float

Price level (1-3)

Google Places API

Company / Account

    +
  • +
+

google_places_candidate_count_mail

integer

Number of results from E-Mail based search

Google Places API

Company / Account

1

google_places_candidate_count_phone

integer

Number of results from Phone based search

Google Places API

Company / Account

1

google_places_place_id_matches_phone_search

boolean

Indicator weather phone based and EMail based search gave the same result

Google Places API

Company / Account

True/False

google_places_confidence

float

Indicator of confidence in the Google result

processing

0.9

google_places_detailed_website

string

Link to business website

Google Places API

Company / Account

www.musterwebsite.de

google_places_detailed_type

list

Type of business

Google Places API

Company / Account

[“florist”, “store”]

reviews_sentiment_score

float

Sentiment score between -1 and 1 for the reviews

GPT

Google reviews

0.9

regional_atlas_pop_density

float

Population density

Regional Atlas

google_places_formatted_address

2649.6

regional_atlas_pop_development

float

Population development

Regional Atlas

google_places_formatted_address

-96.5

regional_atlas_age_0

float

Age group

Regional Atlas

google_places_formatted_address

16.3

regional_atlas_age_1

float

Age group

Regional Atlas

google_places_formatted_address

8.2

regional_atlas_age_2

float

Age group

Regional Atlas

google_places_formatted_address

31.1

regional_atlas_age_3

float

Age group

Regional Atlas

google_places_formatted_address

26.8

regional_atlas_age_4

float

Age group

Regional Atlas

google_places_formatted_address

17.7

regional_atlas_pop_avg_age

float

Average population age

Regional Atlas

google_places_formatted_address

42.1

regional_atlas_per_service_sector

float

    +
  • +
+

Regional Atlas

google_places_formatted_address

88.4

regional_atlas_per_trade

float

    +
  • +
+

Regional Atlas

google_places_formatted_address

28.9

regional_atlas_employment_rate

float

Employment rate

Regional Atlas

google_places_formatted_address

59.9

regional_atlas_unemployment_rate

float

Unemployment rate

Regional Atlas

google_places_formatted_address

6.4

regional_atlas_per_long_term_unemployment

float

Long term unemployment

Regional Atlas

google_places_formatted_address

49.9

regional_atlas_investments_p_employee

float

Investments per employee

Regional Atlas

google_places_formatted_address

6.8

regional_atlas_gross_salary_p_employee

float

Gross salary per employee

Regional Atlas

google_places_formatted_address

63.9

regional_atlas_disp_income_p_inhabitant

float

Income per inhabitant

Regional Atlas

google_places_formatted_address

23703

regional_atlas_tot_income_p_taxpayer

float

Income per taxpayer

Regional Atlas

google_places_formatted_address

45.2

regional_atlas_gdp_p_employee

float

GDP per employee

Regional Atlas

google_places_formatted_address

84983

regional_atlas_gdp_development

float

GDP development

Regional Atlas

google_places_formatted_address

5.2

regional_atlas_gdp_p_inhabitant

float

GDP per inhabitant

Regional Atlas

google_places_formatted_address

61845

regional_atlas_gdp_p_workhours

float

GDP per workhours

Regional Atlas

google_places_formatted_address

60.7

regional_atlas_pop_avg_age_zensus

float

Average population age (from zensus)

Regional Atlas

google_places_formatted_address

41.3

regional_atlas_regional_score

float

Regional score

Regional Atlas

google_places_formatted_address

3761.93

review_avg_grammatical_score

float

Average grammatical score of reviews

processing

google_places_place_id

0.56

review_polarization_type

string

Polarization type of review ratings

processing

google_places_place_id

High-Rating Dominance

review_polarization_score

float

Polarization score of review ratings

processing

google_places_place_id

1

review_highest_rating_ratio

float

Ratio of the highest review ratings

processing

google_places_place_id

1

review_lowest_rating_ratio

float

Ratio of the lowest review ratings

processing

google_places_place_id

0

review_rating_trend

float

Value indicating the trend of ratings

processing

google_places_place_id

0

+
+
+

Google Search Strategy

+ +
+

Google Search Strategy

+
+

Introduction

+

In order to gather more information about a lead, we query the Google Places API. The API has +multiple endpoints, enabling different search method. To have the best chances at correctly identifying a lead +we try to combine the search methods and derive the most probable result.

+
+
Available Lead Information
+ + + + + + + + + + + + + + + + + + + + + + + + + +

First Name

Last Name

Phone Number

Email

Max

Muster

+491721234567

max-muster@mybusiness.com

Melanie

Muster

+491322133321

melanies-flowershop@gmail.nl

+
+
+
Available Search Methods
+
    +
  1. Fulltext Search (used with components of the E-Mail address)

  2. +
  3. Phone Number Search

  4. +
+
+
+
+

Search Strategy

+
    +
  1. Phone Number Search 2) If there’s a valid phone number, look it up

  2. +
  3. Email Based Search 3) If there’s a custom domain, look it up 4) Else: Unless it contains the full name, look up the E-Mail account (everything before the @ sing)

  4. +
  5. If Email-based Search returned any results, use those

  6. +
  7. Else: Return Phone-based search results

  8. +
  9. Else: Return nothing

  10. +
+

Search Strategy

+
+
+
+
+

OpenLLM Business Type Analysis

+ +
+

Business Type Analysis: Research and Proposed Solution

+
+

Research

+

1. Open-source LLM Model : +I explored an open-source LLM model named CrystalChat available on Hugging Face (https://huggingface.co/LLM360/CrystalChat). Despite its capabilities, it has some limitations:

+
    +
  • Computational Intensity: CrystalChat is computationally heavy and cannot be run efficiently on local machines.

  • +
  • Infrastructure Constraints: Running the model on Colab, although feasible, faces GPU limitations.

  • +
+

2. OpenAI as an Alternative : +Given the challenges with the open LLM model, OpenAI’s GPT models provide a viable solution. While GPT is known for its computational costs, it offers unparalleled language understanding and generation capabilities.

+
+
+

Proposed Solution

+

Considering the limitations of CrystalChat and the potential infrastructure costs associated with running an open LLM model on local machines, I propose the following solution:

+
    +
  1. Utilize OpenAI Models: Leverage OpenAI models, which are known for their robust language capabilities.

  2. +
  3. Manage Costs: Acknowledge the computational costs associated with GPT models and explore efficient usage options, such as optimizing queries or using cost-effective computing environments.

  4. +
  5. Experiment with CrystalChat on AWS SageMaker: As part of due diligence, consider executing CrystalChat on AWS SageMaker to evaluate its performance and potential integration.

  6. +
  7. Decision Making: After the experimentation phase, evaluate the performance, costs, and feasibility of both OpenAI and CrystalChat. Make an informed decision based on the achieved results.

  8. +
+
+
+

Conclusion

+

Leveraging OpenAI’s GPT models offers advanced language understanding. To explore the potential of open-source LLM models, an experiment with CrystalChat on AWS SageMaker is suggested before making a final decision.

+
+
+
+
+
+

Classifier Comparison

+ +
+

Classifier Comparison

+
+

Abstract

+

This report presents a comprehensive evaluation of various classifiers trained on the historical dataset, which has been enriched and preprocessed through our pipeline. Each model type was tested on two splits of the data set. The used data set has five +classes for prediction corresponding to different merchant sizes, namely XS, S, M, L, and XL. The first split of the data set used exactly these classes for the prediction corresponding to the exact classes given by SumUp. The other data set split grouped the classes S, M, and L into one new class resulting in three classes of the form {XS}, {S, M, L}, and {XL}. While this does not exactly correspond to the given classes from SumUp, this simplification ofthe prediction task generally resulted in a better F1-score across models.

+
+
+

Experimental Attempts

+

In accordance with the free lunch theorem, indicating no universal model superiority, multiple attempts were made to find the optimal solution. Unfortunately, certain models did not perform satisfactorily. Here are the experimented models and methodolgies

+
    +
  • Quadratic Discriminant Analysis (QDA)

  • +
  • Ridge Classifier

  • +
  • Random Forest

  • +
  • Support Vecotr Machine (SVM)

  • +
  • Fully Connected Neural Networks Classifier Model (FCNNC)

  • +
  • Fully Connected Neural Networks Regression Model (FCNNR)

  • +
  • XGBoost Classifier Model

  • +
  • K Nearest Neighbor Classifier (KNN)

  • +
  • Bernoulli Naive Bayes Classifier

  • +
  • LightGBM

  • +
+
+
+

Models not performing well

+
+

Support Vector Machine Classifier Model

+

Training Support Vector Machine (SVM) took a while such that the training never ended. We believe that it is the case because SVMs are very sensitive to the misclassifications and it finds a hard time minimizing them, given the data.

+
+
+

Fully Connected Neural Networks Classifier Model

+

Fully Connected Neural Networks (FCNN) achieved overall lower performance than that Random Forest Classifier, mainly it had f1 score 0.84 on the XS class, while having 0.00 f1 scores on the other class, it learned only the XS class. the FCNN consisted of 4 layers overall, RELU activation function in each layer, except in the logits layer the activation function is Softmax. The loss functions investigated were Cross-Entropy and L2 Loss. The Optimizers were Adam and Sctohastic Gradient Descent. Moreover, Skip connections, L1 and L2 Regularization techniques and class weights have been investigated as well. Unfortunately we haven’t found any FCNN that outperforms the simpler ML models.

+
+
+

Fully Connected Neural Networks Regression Model

+

There has been an idea written in the scientific paper “Inter-species cell detection - +datasets on pulmonary hemosiderophages in equine, human and feline specimens” by Marzahl et al. (https://www.nature.com/articles/s41597-022-01389-0) where they proposed using regression model on a classification task. The idea is to train the regression model on the class values, whereas the model predicts a continous values and learns the relation between the classes. The output is then subjected to threshholds (0-0.49,0.5-1.49,1.5-2.49,2.5-3.49,3.5-4.5) for classes XS, S, M, L, XL respectivly. This yielded better performance than the FCNN classifier but still was worse than that of the Random Forest.

+
+
+

QDA & Ridge Classifier

+

Both of these classifiers could not produce a satisfactory performance on either data set +split. While the prediction on the XS class was satisfactory (F1-score of ~0.84) all other +classes had F1-scores of ~0.00-0.15. For this reason we are not considering these predictors +in future experiments. This resulted in an overall F1-score of ~0.11, which is significantly +outperformed by the other tested models.

+
+
+

TabNet Architecture

+

TabNet, short for “Tabular Neural Network,” is a novel neural network architecture specifically designed for tabular data, commonly encountered in structured data, such as databases and CSV files. It was introduced in the paper titled “TabNet: Attentive Interpretable Tabular Learning” by Arik et al. (https://arxiv.org/abs/1908.07442). TabNet uses sequential attention to choose which features to reason from at each decision step, enabling interpretability and more efficient learning as the learning capacity is used for the most salient features. Unfortunately, TabNet similarly to our proposed 4 layer network, TabNet only learned the features of the XS class with XS f1 score of 0.84, while the other f1 scores of other classes are zeros. The underlying data does not seem to respond positively to neural network-based approaches.

+
+
+
+

Well performing models

+

In this sub-section we will discuss the results of well performing models, which arer XGBoost, LightGBM, K-Nearest Neighbor (KNN), Random Forest, AdaBoost and Naive Bayes.

+
+

Feature subsets

+

We have collected a lot of features (~54 data points) for the leads, additionally one-hot encoding the categorical variables +results in a high dimensional feature space (132 features). Not all features might be equally relevant for our classification task +so we want to try different subsets.

+

The following subsets are available:

+
    +
  1. google_places_rating, google_places_user_ratings_total, google_places_confidence, regional_atlas_regional_score

  2. +
+
+
+

Overall Results

+

Notes:

+
    +
  • The Random Forest Classifier used 100 estimators.

  • +
  • The AdaBoost Classifier used 100 DecisionTree classifiers.

  • +
  • The KNN classifier used a distance based weighting for the evaluated neighbors and considered 10 neighbors in the 5-class split and 19 neighbors for the 3-class split.

  • +
  • The XGBoost was trained for 10000 rounds.

  • +
  • The LightGBM was trained with 2000 number of leaves

  • +
+

In the following table we can see the model’s overall weighted F1-score on the 3-class and +5-class data set split. The best performing classifiers per row is marked bold.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

KNN

Naive Bayes

Random Forest

XGBoost

AdaBoost

LightGBM

5-Class

0.6314

0.6073

0.6150

0.6442

0.6098

0.6405

3-Class

0.6725

0.6655

0.6642

0.6967

0.6523

0.6956

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

KNN (subset=1)

Naive Bayes (subset=1)

RandomForest (subset=1)

XGBoost (subset=1)

AdaBoost (subset=1)

LightGBM (subset=1)

5-Class

0.6288

0.6075

0.5995

0.6198

0.6090

0.6252

3-Class

0.6680

0.6075

0.6506

0.6664

0.6591

0.6644

+

We can see that all classifiers perform better on the 3-class data set split and that the XGBoost classifier is the best performing for both data set splits. These results are consistent for both the full dataset as well as subset 1. We observe a slight performance for almost all classifiers when using subset 1 compared to the full dataset (except AdaBoost/3-class and Naive Bayes/5-class). This indicates that the few features retained in subset 1 are not the sole discriminant features of the dataset. However, the performance is still high enough to suggest that the features in subset 1 are highly relevant to make classifications on the data.

+
+
+

Results for each class

+
+
5-class split
+

In the following table we can see the F1-score of each model for each class in the 5-class split:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Class

KNN

Naive Bayes

Random Forest

XGBoost

AdaBoost

LightGBM

XS

0.82

0.83

0.81

0.84

0.77

0.83

S

0.15

0.02

0.13

0.13

0.22

0.14

M

0.08

0.02

0.09

0.08

0.14

0.09

L

0.06

0.00

0.08

0.06

0.07

0.05

XL

0.18

0.10

0.15

0.16

0.14

0.21

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Class

KNN (subset=1)

Naive Bayes (subset=1)

RandomForest (subset=1)

XGBoost (subset=1)

AdaBoost (subset=1)

LightGBM (subset=1)

XS

0.82

0.84

0.78

0.84

0.78

0.82

S

0.16

0.00

0.16

0.04

0.19

0.13

M

0.07

0.00

0.07

0.02

0.09

0.08

L

0.07

0.00

0.06

0.05

0.07

0.06

XL

0.19

0.00

0.11

0.13

0.14

0.18

+

For every model we can see that the predictions on the XS class are significantly better than every other class. For the KNN, Random Forest, and XGBoost all perform similar, having second best classes S and XL and worst classes M and L. The Naive Bayes classifier performs significantly worse on the S, M, and L classes and has second best class XL. +Using subset 1 again mostly decreased performance on all classes, with the exception of the KNN classifier and classes L and XL where we can observe a slight increase in F1-score.

+
+
+
3-class split
+

In the following table we can see the F1-score of each model for each class in the 3-class split:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Class

KNN

Naive Bayes

Random Forest

XGBoost

AdaBoost

LightGBM

XS

0.83

0.82

0.81

0.84

0.78

0.83

S,M,L

0.27

0.28

0.30

0.33

0.34

0.34

XL

0.16

0.07

0.13

0.14

0.12

0.19

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Class

KNN (subset=1)

Naive Bayes (subset=1)

RandomForest (subset=1)

XGBoost (subset=1)

AdaBoost (subset=1)

LightGBM (subset=1)

XS

0.82

0.84

0.79

0.84

0.79

0.81

S,M,L

0.29

0.00

0.30

0.22

0.32

0.28

XL

0.18

0.00

0.11

0.11

0.20

0.17

+

For the 3-class split we observe similar performance for the XS and {S, M, L} classes for each model, while the LightGBM model slightly outperforms the other models. The LightGBM classifier is performing the best on the XL class while the Naive Bayes classifier performs worst. Interestingly, we can observe that the performance of the models on the XS class was barely affected by the merging of the S, M, and L classes while the performance on the XL class got worse for all of them. This needs to be considered, when evaluating the overall performance of the models on this data set split. +The AdaBoost Classifier, trained on subset 1, performs best for the XL class. The KNN classifier got a slight boost in performance for the {S, M, L} and XL classes when using subset 1. All other models perform worse on subset 1.

+
+
+
+
+
+

Conclusion

+

In summary, XGBoost consistently demonstrated superior performance, showcasing robust results across various splits and subsets. However, it is crucial to note that its elevated score is attributed to potential overfitting on the XS class. Given SumUp’s emphasis on accurate predictions for higher classes, we recommend considering LightGBM. This model outperformed XGBoost in predicting the XL class and the other classes, offering better results in both the five-class and three-class splits.

+
+
+
+

Concepts, Unrealized Ideas & Miscellaneous

+ +
+

Unused Ideas

+

This document lists ideas and implementations which have either not been tried yet or have been deprecated as they are not used in the current product version but still carry some conceptual value.

+
+

Deprecated

+

The original implementation of the deprecated modules can be found in the deprecated/ directory.

+
+

Controller

+

Note: This package has the additional dependency pydantic==2.4.2

+

The controller module was originally planned to be used as a communication device between EVP and BDC. Whenever the salesperson interface would register a new lead the controller is supposed to trigger the BDC pipeline to enrich the data of that lead and preprocess it to create a feature vector. The successful completion of the BDC pipeline is then registered at the controller which will then trigger an inference of the EVP to compute the predicted merchant size and write this back to the lead data. The computed merchant size can then be used to rank the leads and allow the salesperson to decide the value of the leads and which one to call.

+

The current implementation of the module supports queueing messages from the BDC and EVP as indicated by their type. Depending on the message type the message is then routed to the corresponding module (EVP or BDC). The actual processing of the messages by the modules is not implemented. All of this is done asynchronously by using the python threading library.

+
+
+

FacebookGraphAPI

+

Note: This package has the additional dependency facebook-sdk==3.1.0. Also the environment variables FACEBOOK_APP_ID FACEBOOK_APP_SECRET need to be set with a valid token.

+

This step was supposed to be used for querying lead data from the facebook by using either the business owner’s name or the company name. The attempt was deprecated as the cost for the needed API token was evaluated too high and because the usage permissions of the facebook API were changed. Furthermore, it is paramount to check the legal ramifications of querying facebook for this kind of data as there might be legal consequences of searching for individuals on facebook instead of their businesses due to data privacy regulations in the EU.

+
+
+

ScrapeAddresses

+

This step was an early experiment, using only the custom domain from an email address. We check if there’s a live website running +for the domain, and then try to parse the main site for a business address using a RegEx pattern. The pattern is not very precise +and calling the website, as well as parsing it, takes quite some time, which accumulates for a lot of entries. The Google places +step yields better results for the business address and is faster, that’s why scrape_addresses.py was deprecated.

+
+
+
+

Possible ML improvements

+
+

Creating data subsets

+

The data collected by the BDC pipeline has not been refined to only include semantically valuable data fields. It is possible that some data fields contain no predictive power. This would mean they are practically polluting the dataset with unnecessary information. A proper analysis of the predictive power of all data fields would allow cutting down on the amount of data for each lead, reducing processing time and possibly make predictions more precise. This approach has been explored very briefly by the subset 1 as described in Classifier-Comparison.md. However, the choice of included features has not been justified by experiments making them somewhat arbitrary. Additionally, an analysis of this type could give insights on which data fields to expand on and what new data one might want to collect to increase the EVP’s performance in predicting merchant sizes.

+

Possibly filtering data based on some quality metric could also improve general performance. The regional_atlas_score and google_confidence_score have been tried for this but did not improve performance. However, these values are computed somewhat arbitrarily and implementing a more refined quality metric might result in more promising results.

+
+
+
+
+

Controller

+ +
+

Automation

+

The Controller is a planned component, that has not been implemented beyond a +conceptual prototype. In the planned scenario, the controller would coordinate +BDC, MSP and the external components as a centralized instance of control. In +contrast to our current design, this scenario would enable the automation of our +current workflow, where there are currently several steps of human interaction +required to achieve a prediction result for initially unprocessed lead data.

+
+

Diagrams

+

The following diagrams were created during the prototyping phase for the +Controller component. As they are from an early stage of our project, the +Merchant Size Predictor is labelled as the (Estimated) Value Predictor here.

+
+
Component Diagram
+

Component Diagram

+
+
+
Sequence Diagram
+

Sequence Diagram

+
+
+
Controller Workflow Diagram
+

Controller Workflow Diagram

+
+
+
+
+
+

Twitter API Limitation

+ +
+

Limitations of Twitter API for user information retrieval and biased sentiment analysis

+

This documentation highlights the research and the limitations regarding customer information retrieval and unbiased sentiment analysis when using Twiiter API (tweepy). Two primary constraints include the absence of usernames in provided customer data and inherent biases in tweet content, which significantly impact the API’s utility for these purposes.

+
+

Limitation 1: Absence of usernames in provided customer data:

+

A fundamental shortfall within the Twitter API (tweepy) lies in the unavailability of usernames in the customer information obtained through its endpoints. Twitter (X) primarily uses usernames as identifiers to retrieve user information, on the other hand we only have the Full Names of the customers as indicators.

+
+
+

Limitation 2: Inherent Biases in Tweet Content for Sentiment Analysis:

+

Conducting sentiment analysis on tweets extracted via the Twitter API poses challenges due to inherent biases embedded in tweet done by the customer themselves. Sentiment analysis on something like reviews would be definitely helpful. However, sentiment analysis done on tweet written by customer themselves would deeply imposes biases.

+
+ +
+
+
+

Contribution

+ +
+

Contribution Workflow

+
+

Branching Strategy

+

main: It contains fully stable production code

+
    +
  • dev: It contains stable under-development code

    +
      +
    • epic: It contains a module branch. Like high level of feature. For example, we have an authentication module then we can create a branch like “epic/authentication”

      +
        +
      • feature: It contains specific features under the module. For example, under authentication, we have a feature called registration. Sample branch name: “feature/registration”

      • +
      • bugfix: It contains bug fixing during the testing phase and branch name start with the issue number for example “bugfix/3-validate-for-wrong-user-name”

      • +
      +
    • +
    +
  • +
+
+
+

Commits and Pull Requests

+

The stable branches main and dev are protected against direct pushes. To commit code to these branches create a pull request (PR) describing the feature/bugfix that you are committing to the dev branch. This PR will then be reviewed by another SD from the project. Only after being approved by another SD a PR may be merged into the dev branch. Periodically the stable code on the dev branch will be merged into the main branch by creating a PR from dev. Hence, every feature that should be committed to the main branch must first run without issues on the dev branch for some time.

+

Before contributing to this repository make sure that you are identifiable in your git user settings. This way commits and PRs created by you can be identified and easily traced back.

+
git config --local user.name "Manu Musterperson"
+git config --local user.email "manu@musterperson.org"
+
+
+

Any commit should always contain a commit message that references an issue created in the project. Also, always signoff on your commits for identification reasons.

+
git commit -m "Fixed issue #123" --signoff
+
+
+

When doing pair programming be sure to always have all SDs mentioned in the commit message. Each SD should be listed on a new line for clarity reasons.

+
git commit -a -m "Fixed problem #123
+> Co-authored-by: Manu Musterperson <manu.musterperson@fau.de>" --signoff
+
+
+
+
+

Pull Request Workflow

+

The main and dev branches are protected against direct pushes, which means that we want to do a Pull Request (PR) in order to merge a developed branch into these branches. Having developed a branch (let’s call it feature-1) and we want to merge feature-1 branch into main branch.

+

Here is a standard way to merge pull requests:

+
    +
  1. Have all your local changes added, committed, and pushed on the remote feature-1 branch

    +
    git checkout feature-1
    +git add .
    +git commit -m "added a feature" --signoff  # don't forget the signoff ;)
    +git push
    +
    +
    +
  2. +
  3. Make sure your local main branch up-to-date

    +
    git checkout main
    +git pull main
    +
    +
    +
  4. +
  5. Go to Pull Requests > click on “New pull request” > make sure the base is main branch (or dev branch, depends on which branch you want to update) and the compare to be your feature-1 branch, as highlighted in the photo below and click “create pull requests”: +image

    +

    Make sure to link the issue your PR relates to.

    +
  6. +
  7. Inform the other SDs on slack that you have created the PR and it is awaiting a review and wait for others to review your code. The reviewers will potentially leave comments and change requests in their PR review. If this is the case reason why the change request is not warranted or checkout your branch again and apply the requested changes. Then push your branch once more and request another review by the reviewer. Once there are no more change requests and the PR has been approved by another SD you can merge the PR into the target branch.

  8. +
  9. Delete the feature branch feature-1 once it has been merged into the target branch.

  10. +
+

In case of merge conflict:

+

Should we experience merge conflict after step 3, we should solve the merge conflicts manually, below the title of “This branch has conflicts that must be resolved” click on web editor (you can use vscode or any editor you want). +The conflict should look like this:

+
<<<<<<< HEAD
+// Your changes at **feature-1** branch
+=======
+// Data already on the main branch
+>>>>>>> main
+
+
+

-choose which one of these you would adopt for the merge to the main branch, we would be better off solving the merge -conflicts together rather than alone, feel free to announce it in the slack group chat. +-mark it as resolved and remerge the PR again, there shouldn’t any problem with it.

+

Feel free to add more about that matter here.

+
+
+
+
+

SBOM Generator

+
+

Automatic SBOM generation

+
pipenv install
+pipenv shell
+
+pip install pipreqs
+pip install cyclonedx-bom
+pip install pip-licenses
+
+# Create the SBOM (cyclonedx-bom) based on (pipreqs) requirements that are actually imported in the .py files
+
+$sbom = pipreqs --print | cyclonedx-py -r -pb -o - -i -
+
+# Create an XmlDocument object
+$xml = New-Object System.Xml.XmlDocument
+
+# Load XML content into the XmlDocument
+$xml.LoadXml($sbom)
+
+
+# Create an empty CSV file
+$csvPath = "SBOM.csv"
+
+# Initialize an empty array to store rows
+$result = @()
+
+# Iterate through the XML nodes and create rows for each node
+$xml.SelectNodes("//*[local-name()='component']") | ForEach-Object {
+
+    $row = @{
+        "Version" = $_.Version
+        "Context" = $_.Purl
+        "Name" = if ($_.Name -eq 'scikit_learn') { 'scikit-learn' } else { $_.Name }
+    }
+
+    # Get license information
+    $match = pip-licenses --from=mixed --format=csv --with-system --packages $row.Name | ConvertFrom-Csv
+
+    # Add license information to the row
+    $result += [PSCustomObject]@{
+        "Context" = $row.Context
+        "Name" = $row.Name
+        "Version" = $row.Version
+        "License" = $match.License
+    }
+}
+
+# Export the data to the CSV file
+$result | Export-Csv -Path $csvPath -NoTypeInformation
+
+# Create the license file
+$licensePath = $csvPath + '.license'
+@"
+SPDX-License-Identifier: CC-BY-4.0
+SPDX-FileCopyrightText: 2023 Fabian-Paul Utech <f.utech@gmx.net>
+"@ | Out-File -FilePath $licensePath
+
+exit
+
+
+
+
+
+

Miscellaneous

+ +
+

Miscellaneous Content

+

This file contains content that was moved over from our Wiki, which we gave up in favor of having the documentation available more centrally. The contents of this file might to some extend overlap with the contents found in other documentation files.

+
+
+

Knowledge Base

+
+

AWS

+
    +
  1. New password has to be >= 16 char and contain special chars

  2. +
  3. After changing the password you have to re-login

  4. +
  5. Add MFA (IAM -> Users -> Your Name -> Access Info)

  6. +
  7. MFA device = FirstName.LastName like the credential

  8. +
  9. Re-login

  10. +
  11. Get access keys:

    +
      +
    • IAM -> Users -> Your Name -> Access Info -> Scroll to Access Keys

    • +
    • Create new access key (for local development)

    • +
    • Accept the warning

    • +
    • Copy the secret key to your .env file

    • +
    • Don’t add description tags to your key

    • +
    +
  12. +
+
+
+

PR Management:

+
    +
  1. Create PR

  2. +
  3. Link issue

  4. +
  5. Other SD reviews the PR

    +
      +
    • Modification needed?

      +
        +
      • Fix/Discuss issue in the GitHub comments

      • +
      +
    • +
    • Make new commit

    • +
    • Return to step 3

    • +
    • No Modification needed

    • +
    • Reviewer approves PR

    • +
    +
  6. +
  7. PR creator merges PR

  8. +
  9. Delete the used branch

  10. +
+
+
+

Branch-Management:

+
    +
  • Remove branches after merging

  • +
  • Add reviews / pull requests so others check the code

  • +
  • Feature branches with dev instead of main as base

  • +
+
+
+

Pre-commit:

+
# If not installed yet
+pip install pre-commit
+
+# pre-commit hooks now automatically are executed before every commit
+python -m pre-commit install
+
+# execute pre-commit manually
+python pre-commit
+
+
+
+
+

Features

+
    +
  • Existing Website (Pingable, SEO-Score, DNS Lookup)

  • +
  • Existing Google Business Entry (using the Google Places API

    +
      +
    • Opening Times

    • +
    • Number, Quality of Ratings

    • +
    • Overall “completeness” of the entry/# of available datapoints

    • +
    • Price category

    • +
    • Phone Number (compare with lead form input)

    • +
    • Website (compare with lead form input)

    • +
    • Number of visitors (estimate revenue from that?)

    • +
    • Product recognition from images

    • +
    • Merchant Category (e.g. cafe, restaurant, retailer, etc.)

    • +
    +
  • +
  • Performance Indicators (NorthData, some other API)

    +
      +
    • Revenue (as I understodd, this should be > 5000$/month)

    • +
    • Number of Employees

    • +
    • Bundesanzeiger / Handelsregister (Deutschland API)

    • +
    +
  • +
  • Popularity: Insta / facebook followers or website ranking on google

  • +
  • Business type: google or website extraction (maybe with ChatGPT)

  • +
  • Size of business: To categorize leads to decide whether they need to deal with a salesperson or self-direct their solution

  • +
  • Business profile

  • +
  • Sentiment Analysis: https://arxiv.org/pdf/2307.10234.pdf

  • +
+
+
+

Storage

+
    +
  • Unique ID for Lead (Felix)?

  • +
  • How to handle frequent data layout changes at S3 (Simon)?

  • +
  • 3 stage file systems (Felix) vs. DB (Ruchita)?

  • +
  • 3 stage file system (Felix):

    +
      +
    • BDC trigger on single new lead entries or batches

    • +
    • After BDC enriched the data => store in a parquet file in the events folder with some tag

    • +
    • BDC triggers the creation of the feature vectors

    • +
    • Transform the data in the parquet file after it was stored in the events file and store them in the feature folder with the same tag

    • +
    • Use the data as a input for the model, which is triggered after the creation of the input, and store the results in the model folder

    • +
    +
  • +
  • Maybe the 3 stage file system as a part of the DB and hide the final decision behind the database abstraction layer (Simon)?

  • +
+
+
+

Control flow (Berkay)

+
    +
  • Listener

  • +
  • MessageQueue

  • +
  • RoutingQueue

  • +
+

Listener, as the name suggests, listens for incoming messages from other component, such as BDC, EVP, and enqueues these messages in messageQueue to be “read” and processed. If there are not incoming messages, it is in idle status. messageQueue is, where listened messages are being processed. After each message is processed by messageQueue,it is enqueued in routingQueue, to be routed to corresponding component. Both messageQueue and routingQueue are in idle, if there are no elements in queues. Whole concept of Controller is multi-threaded and asynchronous. While it accepts new incoming messages, it processes messages and at the same time routes some other messages.

+
+
+

AI

+
+

expected value = life-time value of lead x probability of the lead becoming a customer

+
+

AI models needed that solve a regression or probability problem

+
+
AI Models
+
    +
  • Classification:

    +
      +
    • Decision Trees

    • +
    • Random Forest

    • +
    • Neural Networks

    • +
    • Naïve Bayes

    • +
    +
  • +
+
+
+
What data do we need?
+
    +
  • Classification: Labeled data

  • +
  • Probability: Data with leads and customers

  • +
+
+
+
ML Pipeline
+
    +
  1. Preprocessing

  2. +
  3. Feature selection

  4. +
  5. Dataset split / cross validation

  6. +
  7. Dimensional reduction

  8. +
  9. Training

  10. +
  11. Testing / Evaluation

  12. +
  13. Improve performance

    +
      +
    • Batch Normalization

    • +
    • Optimizer

    • +
    • L1 / L2 regularization: reduced overfitting by regularize the model

    • +
    • Dropout (NN)

    • +
    • Depth and width (NN)

    • +
    • Initialization techniques (NN: Xavier and He)

      +
        +
      • He: Layers with ReLu activation

      • +
      • Xavier: Layers with sigmoid activation

      • +
      +
    • +
    +
  14. +
+
+
+
+
+

Troubleshooting

+
+

Build

+
+
pipenv
+
+
install stuck
+
pipenv install –dev
+
+
+

Solution: Remove .lock file + restart PC

+
+
+
+
Docker
+
+
VSCode
+

Terminal can’t run docker image (on windows)

+
    +
  • Solution: workaround with git bash or with ubuntu

  • +
+
+
+
+
Testing
+
+
Reuse
+

don’t analyze a certain part of the code with reuse +Solution:

+
# REUSE-IgnoreStart
+  ...
+# REUSE-IgnoreEnd
+
+
+
+
+
Failed checks
+
    +
  1. Go to the specific pull request or Actions Actions

  2. +
  3. Click “show all checks”

  4. +
  5. Click “details”

  6. +
  7. Click on the elements with the “red marks”

  8. +
+
+
+
+
+

BDC

+
+
Google Places API
+

Language is adjusted to the location from which the API is run

+
    +
  • Solution: adjust the language feature, documentation in Google Solution

  • +
+

Google search results are based on the location from which the API is run

+
    +
  • Solution: Pass a fixed point in the center of the country / city / area of the company (OSMNX) as a location bias, documentation in +Google Solution

  • +
+
+
+
+

Branch-Management

+
+
Divergent branch
+

Commits on local and remote are not the same

+
    +
  • Solution:

    +
      +
    1. Pull remote changes

    2. +
    3. Rebase the changes

    4. +
    5. Solve any conflict during any commit you get from remote

    6. +
    +
  • +
+
+
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/evp.html b/evp.html new file mode 100644 index 0000000..5ff0d17 --- /dev/null +++ b/evp.html @@ -0,0 +1,382 @@ + + + + + + + evp package — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

evp package

+
+

Submodules

+
+
+

evp.evp module

+
+
+class evp.evp.EstimatedValuePredictor(data: DataFrame, train_size=0.8, val_size=0.1, test_size=0.1, model_type: Predictors = Predictors.RandomForest, model_name: str | None = None, limit_classes: bool = False, selected_features: list | None = None, **model_args)[source]
+

Bases: object

+
+
+lead_classifier: Classifier
+
+ +
+
+predict(X) list[MerchantSizeByDPV][source]
+
+ +
+
+save_model() None[source]
+
+ +
+
+train(epochs=1, batch_size=None) None[source]
+
+ +
+ +
+
+

evp.predictors module

+
+
+class evp.predictors.AdaBoost(model_name: str | None = None, n_estimators=100, class_weight=None, random_state=42)[source]
+

Bases: Classifier

+
+
+predict(X) MerchantSizeByDPV[source]
+
+ +
+
+train(X_train, y_train, X_test, y_test, epochs=1, batch_size=None) None[source]
+
+ +
+ +
+
+class evp.predictors.Classifier(model_name: str | None = None, *args, **kwargs)[source]
+

Bases: ABC

+
+
+load(model_name: str) None[source]
+
+ +
+
+abstract predict(X) list[MerchantSizeByDPV][source]
+
+ +
+
+save(num_classes: int = 5) None[source]
+
+ +
+
+abstract train(X_train, y_train, X_test, y_test, epochs=1, batch_size=None) None[source]
+
+ +
+ +
+
+class evp.predictors.KNNClassifier(model_name: str | None = None, random_state=42, n_neighbors=10, weights='distance')[source]
+

Bases: Classifier

+
+
+predict(X) list[MerchantSizeByDPV][source]
+
+ +
+
+train(X_train, y_train, X_test, y_test, epochs=1, batch_size=None) None[source]
+
+ +
+ +
+
+class evp.predictors.LightGBM(model_name: str | None = None, num_leaves=1000, random_state=42)[source]
+

Bases: Classifier

+
+
+predict(X) MerchantSizeByDPV[source]
+
+ +
+
+train(X_train, y_train, X_test, y_test, epochs=1, batch_size=None) None[source]
+
+ +
+ +
+
+class evp.predictors.MerchantSizeByDPV(value)[source]
+

Bases: Enum

+

An enumeration.

+
+
+Invalid = -1
+
+ +
+
+L = 3
+
+ +
+
+M = 2
+
+ +
+
+S = 1
+
+ +
+
+XL = 4
+
+ +
+
+XS = 0
+
+ +
+ +
+
+class evp.predictors.NaiveBayesClassifier(model_name: str | None = None, random_state=42)[source]
+

Bases: Classifier

+
+
+predict(X) list[MerchantSizeByDPV][source]
+
+ +
+
+train(X_train, y_train, X_test, y_test, epochs=1, batch_size=None) None[source]
+
+ +
+ +
+
+class evp.predictors.Predictors(value)[source]
+

Bases: Enum

+

An enumeration.

+
+
+AdaBoost = 'AdaBoost'
+
+ +
+
+KNN = 'KNN Classifier'
+
+ +
+
+LightGBM = 'LightGBM'
+
+ +
+
+NaiveBayes = 'Naive Bayes'
+
+ +
+
+RandomForest = 'Random Forest'
+
+ +
+
+XGBoost = 'XGBoost'
+
+ +
+ +
+
+class evp.predictors.RandomForest(model_name: str | None = None, n_estimators=100, class_weight=None, random_state=42)[source]
+

Bases: Classifier

+
+
+predict(X) MerchantSizeByDPV[source]
+
+ +
+
+train(X_train, y_train, X_test, y_test, epochs=1, batch_size=None) None[source]
+
+ +
+ +
+
+class evp.predictors.XGB(model_name: str | None = None, num_rounds=2000, random_state=42)[source]
+

Bases: Classifier

+
+
+predict(X) MerchantSizeByDPV[source]
+
+ +
+
+train(X_train, y_train, X_test, y_test, epochs=1, batch_size=None) None[source]
+
+ +
+ +
+
+

Module contents

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/genindex.html b/genindex.html new file mode 100644 index 0000000..8c188a5 --- /dev/null +++ b/genindex.html @@ -0,0 +1,1456 @@ + + + + + + Index — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    +
  • + +
  • +
  • +
+
+
+
+
+ + +

Index

+ +
+ _ + | A + | B + | C + | D + | E + | F + | G + | H + | I + | K + | L + | M + | N + | O + | P + | R + | S + | T + | U + | V + | X + | Y + +
+

_

+ + + +
+ +

A

+ + + +
+ +

B

+ + + +
+ +

C

+ + + +
+ +

D

+ + + +
+ +

E

+ + + +
+ +

F

+ + + +
+ +

G

+ + + +
+ +

H

+ + + +
+ +

I

+ + + +
+ +

K

+ + + +
+ +

L

+ + + +
+ +

M

+ + + +
+ +

N

+ + + +
+ +

O

+ + + +
+ +

P

+ + + +
+ +

R

+ + + +
+ +

S

+ + + +
+ +

T

+ + + +
+ +

U

+ + + +
+ +

V

+ + +
+ +

X

+ + + +
+ +

Y

+ + +
+ + + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..9b244a5 --- /dev/null +++ b/index.html @@ -0,0 +1,182 @@ + + + + + + + Welcome to Sales Lead Qualifier’s documentation! — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/logger.html b/logger.html new file mode 100644 index 0000000..9088e40 --- /dev/null +++ b/logger.html @@ -0,0 +1,283 @@ + + + + + + + logger package — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

logger package

+
+

Submodules

+
+
+

logger.logger module

+
+
+class logger.logger.CustomLogger(name, log_dir=None)[source]
+

Bases: Logger

+
+
+add_file_handler(name, log_dir)[source]
+

Add a file handler for this logger with the specified name (and +store the log file under log_dir).

+
+ +
+
+disable_console_output()[source]
+
+ +
+
+disable_file_output()[source]
+
+ +
+
+enable_console_output()[source]
+
+ +
+
+enable_file_output()[source]
+
+ +
+
+has_console_handler()[source]
+
+ +
+
+has_file_handler()[source]
+
+ +
+ +
+
+class logger.logger.FileOutFormatter[source]
+

Bases: Formatter

+
+
+fmt = '%(asctime)s | %(levelname)8s | %(filename)s:%(lineno)d | %(message)s'
+
+ +
+
+format(record)[source]
+

Format the specified record as text.

+

The record’s attribute dictionary is used as the operand to a +string formatting operation which yields the returned string. +Before formatting the dictionary, a couple of preparatory steps +are carried out. The message attribute of the record is computed +using LogRecord.getMessage(). If the formatting string uses the +time (as determined by a call to usesTime(), formatTime() is +called to format the event time. If there is exception information, +it is formatted using formatException() and appended to the message.

+
+ +
+ +
+
+class logger.logger.StdOutFormatter[source]
+

Bases: Formatter

+
+
+FORMATS = {10: '\x1b[38;20m%(asctime)s | %(levelname)8s | %(filename)s:%(lineno)d | %(message)s\x1b[0m', 20: '\x1b[34m%(asctime)s | %(levelname)8s | %(filename)s:%(lineno)d | %(message)s\x1b[0m', 30: '\x1b[33;20m%(asctime)s | %(levelname)8s | %(filename)s:%(lineno)d | %(message)s\x1b[0m', 40: '\x1b[31;20m%(asctime)s | %(levelname)8s | %(filename)s:%(lineno)d | %(message)s\x1b[0m', 50: '\x1b[31;1m%(asctime)s | %(levelname)8s | %(filename)s:%(lineno)d | %(message)s\x1b[0m'}
+
+ +
+
+blue = '\x1b[34m'
+
+ +
+
+bold_red = '\x1b[31;1m'
+
+ +
+
+fmt = '%(asctime)s | %(levelname)8s | %(filename)s:%(lineno)d | %(message)s'
+
+ +
+
+format(record)[source]
+

Format the specified record as text.

+

The record’s attribute dictionary is used as the operand to a +string formatting operation which yields the returned string. +Before formatting the dictionary, a couple of preparatory steps +are carried out. The message attribute of the record is computed +using LogRecord.getMessage(). If the formatting string uses the +time (as determined by a call to usesTime(), formatTime() is +called to format the event time. If there is exception information, +it is formatted using formatException() and appended to the message.

+
+ +
+
+grey = '\x1b[38;20m'
+
+ +
+
+red = '\x1b[31;20m'
+
+ +
+
+reset = '\x1b[0m'
+
+ +
+
+yellow = '\x1b[33;20m'
+
+ +
+ +
+
+

Module contents

+
+
+logger.get_logger() CustomLogger[source]
+
+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/main.html b/main.html new file mode 100644 index 0000000..c0868ae --- /dev/null +++ b/main.html @@ -0,0 +1,128 @@ + + + + + + + main module — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

main module

+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/modules.html b/modules.html new file mode 100644 index 0000000..325daee --- /dev/null +++ b/modules.html @@ -0,0 +1,346 @@ + + + + + + + src — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

src

+
+ +
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/objects.inv b/objects.inv new file mode 100644 index 0000000..d60ff1d Binary files /dev/null and b/objects.inv differ diff --git a/preprocessing.html b/preprocessing.html new file mode 100644 index 0000000..9ba9055 --- /dev/null +++ b/preprocessing.html @@ -0,0 +1,209 @@ + + + + + + + preprocessing package — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ +
+

preprocessing package

+
+

Submodules

+
+
+

preprocessing.preprocessing module

+
+
+class preprocessing.preprocessing.Preprocessing(filter_null_data=True, historical_bool=True)[source]
+

Bases: object

+
+
+class_label_encoding(column)[source]
+
+ +
+
+fill_missing_values(column, strategy='constant')[source]
+
+ +
+
+filter_out_null_data()[source]
+
+ +
+
+implement_preprocessing_pipeline()[source]
+
+ +
+
+min_max_scaling(column)[source]
+
+ +
+
+multiple_label_encoding(column)[source]
+
+ +
+
+normalization(column)[source]
+
+ +
+
+remove_outliers_zscore(column)[source]
+
+ +
+
+robust_scaling(column)[source]
+
+ +
+
+save_preprocessed_data()[source]
+
+ +
+
+single_one_hot_encoding(column)[source]
+
+ +
+
+standard_scaling(column)[source]
+
+ +
+ +
+
+

Module contents

+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/py-modindex.html b/py-modindex.html new file mode 100644 index 0000000..fb8b3a0 --- /dev/null +++ b/py-modindex.html @@ -0,0 +1,327 @@ + + + + + + Python Module Index — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    +
  • + +
  • +
  • +
+
+
+
+
+ + +

Python Module Index

+ +
+ b | + c | + d | + e | + l | + m | + p +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+ b
+ bdc +
    + bdc.pipeline +
    + bdc.steps +
    + bdc.steps.analyze_emails +
    + bdc.steps.analyze_reviews +
    + bdc.steps.google_places +
    + bdc.steps.google_places_detailed +
    + bdc.steps.gpt_summarizer +
    + bdc.steps.hash_generator +
    + bdc.steps.helpers +
    + bdc.steps.helpers.generate_hash_leads +
    + bdc.steps.helpers.offeneregister_api +
    + bdc.steps.helpers.text_analyzer +
    + bdc.steps.preprocess_phonenumbers +
    + bdc.steps.regionalatlas +
    + bdc.steps.search_offeneregister +
    + bdc.steps.step +
 
+ c
+ config +
 
+ d
+ database +
    + database.leads +
    + database.leads.local_repository +
    + database.leads.repository +
    + database.leads.s3_repository +
+ demo +
    + demo.console_utils +
    + demo.demos +
    + demo.pipeline_utils +
 
+ e
+ evp +
    + evp.evp +
    + evp.predictors +
 
+ l
+ logger +
    + logger.logger +
 
+ m
+ main +
 
+ p
+ preprocessing +
    + preprocessing.preprocessing +
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/readme_link.html b/readme_link.html new file mode 100644 index 0000000..aeb7109 --- /dev/null +++ b/readme_link.html @@ -0,0 +1,222 @@ + + + + + + + Sales-Lead-Qualifier Project (AMOS WS 2023/24) — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+ +
+
+
+
+ + + +
+

Sales-Lead-Qualifier Project (AMOS WS 2023/24)

+ +
+

Creating the Environment

+

The repository contains the file .env.template. This file is a template for the environment variables that need to be set for the application to run. Copy this file into a file called .env at the root level of this repository and fill in all values with the corresponding secrets.

+

To create the virtual environment in this project you must have pipenv installed on your machine. Then run the following commands:

+
# for development environment
+pipenv install --dev
+# for production environment
+pipenv install
+
+
+

To work within the environment you can now run:

+
# to activate the virtual environment
+pipenv shell
+# to run a single command
+pipenv run <COMMAND>
+
+
+

To install new packages in the environment add them to the Pipfile. Always pin the exact package version to avoid package conflicts and unexpected side effects from package upgrades.

+
# to add a package to the development environment
+[dev-packages]
+<PACKAGE_NAME> = "==<VERSION_NUMBER>"
+# to add a package to the production environment
+[packages]
+<PACKAGE_NAME> = "==<VERSION_NUMBER>"
+
+
+

Note that this project runs under an MIT license and we only permit the use of non-copyleft-licensed packages. Please be aware of this when installing new packages and inform yourself before blindly installing.

+

When you have any issues with the environment contact felix-zailskas.

+
+
+

Build Process

+

This application is run using a Docker container. For this the Dockerfile at root level is used. It copies the Pipfile to the container and installs the deployment environment using pipenv. Afterwards all source code from the src/. As the entrypoint the main.py is chosen. Ensure that Docker is installed and that the Docker daemon is running.

+

To build the application run

+
./build_app.sh
+
+
+

To run the application interactively run

+
./run_app.sh
+
+
+
+
+

Database Connection

+

To build the Docker containers

+
docker-compose build
+
+
+

To run the Docker containers

+
docker-compose run sumup_app
+
+
+
+

License

+

This project is operated under an MIT license. Every file must contain the REUSE-compliant license and copyright declaration:

+

REUSE documentation

+
# SPDX-License-Identifier: MIT
+# SPDX-FileCopyrightText: 2023
+
+
+
+
+

Pre-Commit Hooks

+

This repository uses pre-commit hooks to ensure a consistent and clean file organization. Each registered hook will be executed when committing to the repository. To ensure that the hooks will be executed they need to be installed using the following command:

+
pre-commit install
+
+
+

The following things are done by hooks automatically:

+
    +
  • formatting of python files using black and isort

  • +
  • formatting of other files using prettier

  • +
  • syntax check of JSON and yaml files

  • +
  • adding new line at the end of files

  • +
  • removing trailing whitespaces

  • +
  • prevent commits to dev and main branch

  • +
  • check adherence to REUSE licensing format

  • +
+
+
+
+ + +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/search.html b/search.html new file mode 100644 index 0000000..45fcf0e --- /dev/null +++ b/search.html @@ -0,0 +1,128 @@ + + + + + + Search — Sales Lead Qualifier 01.00.00 documentation + + + + + + + + + + + + + + + + + + + + +
+ + +
+ +
+
+
+
    +
  • + +
  • +
  • +
+
+
+
+
+ + + + +
+ +
+ +
+
+ +
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/searchindex.js b/searchindex.js new file mode 100644 index 0000000..9c2c98c --- /dev/null +++ b/searchindex.js @@ -0,0 +1 @@ +Search.setIndex({"docnames": ["bdc", "bdc.steps", "bdc.steps.helpers", "config", "database", "database.leads", "demo", "documentation", "evp", "index", "logger", "main", "modules", "preprocessing", "readme_link"], "filenames": ["bdc.rst", "bdc.steps.rst", "bdc.steps.helpers.rst", "config.rst", "database.rst", "database.leads.rst", "demo.rst", "documentation.rst", "evp.rst", "index.rst", "logger.rst", "main.rst", "modules.rst", "preprocessing.rst", "readme_link.md"], "titles": ["bdc package", "bdc.steps package", "bdc.steps.helpers package", "config module", "database package", "database.leads package", "demo package", "Build Documentation", "evp package", "Welcome to Sales Lead Qualifier\u2019s documentation!", "logger package", "main module", "src", "preprocessing package", "Sales-Lead-Qualifier Project (AMOS WS 2023/24)"], "terms": {"step": [0, 5, 6, 7, 10, 12], "helper": [0, 1], "generate_hash_lead": [0, 1], "offeneregister_api": [0, 1], "text_analyz": [0, 1], "analyze_email": [0, 12], "analyzeemail": [0, 1], "name": [0, 1, 2, 5, 6, 7, 10], "added_col": [0, 1], "required_col": [0, 1], "finish": [0, 1], "load_data": [0, 1], "run": [0, 1, 5, 6, 9, 12, 14], "verifi": [0, 1], "analyze_email_account": [0, 1], "extract_custom_domain": [0, 1], "analyze_review": [0, 12], "gptreviewsentimentanalyz": [0, 1], "model": [0, 1, 5], "model_encoding_nam": [0, 1], "max_prompt_token": [0, 1], "no_answ": [0, 1], "gpt_required_field": [0, 1], "system_message_for_sentiment_analysi": [0, 1], "user_message_for_sentiment_analysi": [0, 1], "extracted_col_nam": [0, 1], "gpt": [0, 1, 5, 7], "run_sentiment_analysi": [0, 1], "gpt_sentiment_analyze_review": [0, 1], "extract_text_from_review": [0, 1], "num_tokens_from_str": [0, 1], "batch_review": [0, 1], "gpt_calculate_avg_sentiment_scor": [0, 1], "textblob_calculate_avg_sentiment_scor": [0, 1], "smartreviewinsightsenhanc": [0, 1], "required_field": [0, 1], "language_tool": [0, 1], "min_ratings_count": [0, 1], "rating_dominance_threshold": [0, 1], "_get_language_tool": [0, 1], "_enhance_review_insight": [0, 1], "_analyze_rating_trend": [0, 1], "_quantify_polar": [0, 1], "_determine_polarization_typ": [0, 1], "_calculate_average_grammatical_scor": [0, 1], "_calculate_scor": [0, 1], "_grammatical_error": [0, 1], "check_api_kei": [0, 1], "is_review_valid": [0, 1], "log": [0, 1, 7, 10], "google_plac": [0, 12], "googleplac": [0, 1], "api_field": [0, 1], "calculate_confid": [0, 1], "df_field": [0, 1], "get_data_from_google_api": [0, 1], "get_first_place_candid": [0, 1], "gmap": [0, 1], "google_places_detail": [0, 12], "googleplacesdetail": [0, 1], "api_fields_output": [0, 1], "get_data_from_detailed_google_api": [0, 1], "gpt_summar": [0, 12], "gptsummar": [0, 1], "client": [0, 1, 7], "extract_the_raw_html_and_pars": [0, 1], "extracted_col_name_website_summari": [0, 1], "summarize_the_company_websit": [0, 1], "system_message_for_website_summari": [0, 1], "user_message_for_website_summari": [0, 1], "hash_gener": [0, 12], "hashgener": [0, 1], "preprocess_phonenumb": [0, 12], "preprocessphonenumb": [0, 1], "check_numb": [0, 1], "process_row": [0, 1], "regionalatla": [0, 7, 12], "reagionalatlas_feature_kei": [0, 1], "regions_gdf": [0, 1], "empty_result": [0, 1], "epsg_code_etr": [0, 1], "calculate_regional_scor": [0, 1], "get_data_from_address": [0, 1], "search_offeneregist": [0, 12], "searchoffeneregist": [0, 1], "offeneregisterapi": [0, 1, 2, 7], "_extract_company_related_data": [0, 1], "check_data_pres": [0, 1], "df": [0, 1, 5], "steperror": [0, 1], "class": [0, 1, 2, 5, 8, 10, 13], "limit": [0, 1, 6, 9], "int": [0, 1, 2, 6, 8], "none": [0, 1, 2, 5, 6, 8, 10], "sourc": [0, 1, 2, 4, 5, 6, 8, 10, 13, 14], "base": [0, 1, 2, 5, 8, 10, 13], "object": [0, 1, 2, 5, 7, 8, 13], "leadhashgener": [1, 2], "base_path": [1, 2, 4, 5], "hash_check": [1, 2], "hash_lead": [1, 2], "find_companyaddress_by_lastname_firstnam": [1, 2], "find_companycapitals_by_lastname_firstnam": [1, 2], "find_companyname_by_lastname_firstnam": [1, 2], "find_companyobjective_by_lastname_firstnam": [1, 2], "textanalyz": [1, 2], "target_lang": [1, 2], "calculate_sentiment_analysis_scor": [1, 2], "correct_text": [1, 2], "find_number_of_grammatical_error": [1, 2], "find_number_of_spelling_error": [1, 2], "find_spelling_error": [1, 2], "translat": [1, 2], "get_lead_hash_gener": [1, 2], "force_refresh": [1, 5], "bool": [1, 5, 6, 8], "fals": [1, 5, 6, 7, 8], "A": [1, 2, 6, 7], "pipelin": [1, 5, 6, 12], "perform": 1, "variou": [1, 2, 7], "preprocess": [1, 5, 9, 12], "given": [1, 2, 5, 6, 7], "email": [1, 7], "address": [1, 2, 7], "The": [1, 2, 5, 6, 7, 10, 14], "follow": [1, 7, 14], "column": [1, 13], "ad": [1, 7, 14], "success": [1, 7], "process": [1, 6, 9], "domain": [1, 7], "custom": [1, 6], "websit": [1, 2, 7], "ani": [1, 7, 14], "email_valid": [1, 7], "boolean": [1, 7], "result": [1, 5], "check": [1, 2, 5, 14], "first_name_in_account": [1, 7], "true": [1, 5, 6, 7, 13], "first": [1, 2, 7], "i": [1, 2, 6, 7, 10, 14], "part": [1, 7], "account": [1, 7], "last_name_in_account": [1, 7], "last": [1, 2, 7], "thi": [1, 7, 10, 14], "us": [1, 2, 5, 7, 10, 14], "type": [1, 2, 6, 9], "str": [1, 2, 5, 6, 8], "list": [1, 2, 6, 7, 8], "field": [1, 9], "main": [1, 7, 9, 12, 14], "datafram": [1, 5, 8], "execut": [1, 6, 7, 14], "ar": [1, 7, 10, 14], "requir": [1, 7], "exist": [1, 7], "input": [1, 2, 5, 6, 7], "befor": [1, 7, 10, 14], "print": [1, 7], "report": [1, 5, 7], "clean": [1, 5, 7, 14], "up": [1, 5, 7], "temporari": 1, "file": [1, 5, 6, 7, 10, 14], "Will": 1, "fail": 1, "load": [1, 5, 7, 8, 12], "data": [1, 2, 5, 6, 8, 9], "could": [1, 7], "an": [1, 2, 6, 7, 8, 14], "api": [1, 9], "call": [1, 7, 10, 14], "read": [1, 7], "from": [1, 2, 5, 6, 7, 14], "csv": [1, 5, 9], "can": [1, 7, 14], "also": [1, 7], "empti": [1, 6, 7], "self": [1, 7], "analyz": [1, 2, 7], "actual": [1, 7], "rais": [1, 6], "ha": [1, 7], "been": [1, 7], "correctli": [1, 7], "present": [1, 7], "format": [1, 5, 7, 10, 12, 14], "If": [1, 2, 6, 7, 10], "lead": [1, 2, 4, 6, 12], "seri": [1, 2, 7], "sentiment": [1, 2], "analysi": [1, 2, 9], "review": [1, 4, 5, 7], "4": [1, 8], "encod": [1, 7], "maximum": [1, 2, 7], "number": [1, 2, 6, 7], "token": [1, 7], "allow": [1, 7], "prompt": [1, 6, 7], "default": [1, 2, 5, 6], "valu": [1, 6, 8, 14], "answer": 1, "dict": [1, 2, 5], "system": [1, 7], "messag": [1, 6, 7, 10], "user": [1, 6, 9], "store": [1, 5, 7, 10], "score": [1, 7], "addit": [1, 6, 7], "instanc": [1, 7], "openai": [1, 7], "valid": [1, 6, 7], "kei": [1, 5, 7], "place_id": [1, 5], "review_list": 1, "calcul": [1, 2], "reviews_list": 1, "extract": [1, 7], "text": [1, 2, 10], "remov": [1, 7, 14], "line": [1, 7, 14], "charact": 1, "return": [1, 2, 5, 6, 7, 10], "string": [1, 5, 6, 7, 10], "max_token": 1, "batch": [1, 7], "smaller": 1, "reviews_sentiment_scor": [1, 7], "float": [1, 2, 7], "4096": 1, "paramet": [1, 2, 5, 6], "averag": [1, 7], "google_places_place_id": [1, 7], "consid": [1, 7], "cl100k_base": 1, "dict_valu": 1, "compani": [1, 2, 7], "": [1, 5, 8, 10, 12], "id": [1, 2, 5, 7], "place": 1, "you": [1, 7, 14], "being": [1, 7], "provid": [1, 2], "come": 1, "between": [1, 7], "rang": [1, 6], "1": [1, 8], "just": [1, 7], "textblob": 1, "dictionari": [1, 10], "contain": [1, 2, 7, 14], "languag": [1, 2, 7], "inform": [1, 2, 10, 14], "me": 1, "otherwis": [1, 2, 7], "enhanc": [1, 7], "insight": [1, 7, 9], "smart": [1, 7], "tool": [1, 7], "differ": [1, 7], "minimum": 1, "rate": [1, 7], "identifi": [1, 5, 7, 14], "polar": [1, 7], "threshold": 1, "high": [1, 7], "low": 1, "domin": [1, 7], "decim": 1, "lang": [1, 2], "get": [1, 7], "specifi": [1, 2, 5, 6, 10], "rating_tim": 1, "gener": [1, 9], "trend": [1, 7], "over": [1, 7], "time": [1, 7, 10], "quantifi": 1, "polarization_scor": 1, "highest_rating_ratio": 1, "lowest_rating_ratio": 1, "determin": [1, 10], "ratio": [1, 7], "grammat": [1, 2, 7], "error": [1, 2, 7], "review_avg_grammatical_scor": [1, 7], "review_polarization_typ": [1, 7], "review_polarization_scor": [1, 7], "review_highest_rating_ratio": [1, 7], "highest": [1, 7], "review_lowest_rating_ratio": [1, 7], "lowest": [1, 7], "review_rating_trend": [1, 7], "0": [1, 8], "api_kei": 1, "api_nam": 1, "specif": [1, 7], "origin": [1, 7], "repres": 1, "customlogg": [1, 10, 12], "amo": [1, 5, 7, 9], "app": [1, 9], "debug": 1, "function": [1, 2, 6, 7], "try": [1, 7], "find": [1, 2, 7], "correct": [1, 2, 7], "busi": [1, 9], "entri": [1, 7], "googl": [1, 9], "map": [1, 7], "databas": [1, 2, 7, 9, 12], "It": [1, 6, 7, 14], "save": [1, 5, 7, 8, 12], "basic": [1, 7], "along": [1, 7], "retriev": [1, 2, 5, 6], "further": [1, 7], "detail": [1, 7], "confid": [1, 7], "should": [1, 7], "indic": [1, 7], "have": [1, 7, 14], "found": [1, 2, 7], "vari": 1, "multipl": [1, 7], "higher": [1, 7], "when": [1, 5, 7, 14], "match": [1, 7], "prefix": [1, 5], "google_places_business_statu": [1, 7], "statu": [1, 7], "google_places_formatted_address": [1, 7], "google_places_nam": [1, 7], "google_places_user_ratings_tot": [1, 7], "google_places_r": [1, 7], "google_places_price_level": [1, 7], "price": [1, 7], "level": [1, 7, 14], "google_places_candidate_count_mail": [1, 7], "candid": 1, "mail": [1, 7], "search": [1, 9], "google_places_candidate_count_phon": [1, 7], "phone": [1, 7], "google_places_place_id_matches_phone_search": [1, 7], "whether": [1, 5, 7], "one": [1, 6, 7], "google_places_confid": [1, 7], "business_statu": 1, "formatted_address": 1, "user_ratings_tot": 1, "price_level": 1, "results_list": 1, "some": [1, 7], "how": [1, 7], "sure": [1, 7], "we": [1, 14], "super": 1, "secret": [1, 7, 14], "patent": 1, "ai": 1, "algorithm": [1, 7], "p": 1, "param": [1, 5, 6], "candidate_count_mail": 1, "candidate_count_phon": 1, "place_id_matches_phone_search": 1, "lead_row": 1, "request": 1, "queri": [1, 7], "input_typ": 1, "make": [1, 7], "construct": 1, "number_format": [1, 7], "gather": [1, 7], "link": 1, "separ": [1, 7], "locat": [1, 5, 7], "persist": 1, "set": [1, 2, 6, 7, 14], "local": [1, 7], "aw": 1, "s3": [1, 5, 7], "google_places_detailed_websit": [1, 7], "google_places_detailed_typ": [1, 7], "attempt": [1, 2], "download": [1, 7], "raw": [1, 7], "html": [1, 7], "pass": [1, 7], "which": [1, 6, 7, 10], "summar": [1, 7], "valuabl": [1, 7], "salesperson": [1, 7], "sales_person_summari": 1, "summari": [1, 7], "url": [1, 2, 5], "summaris": 1, "handl": [1, 7], "except": [1, 7, 10], "mightaris": 1, "three": [1, 7], "five": [1, 7], "sentenc": 1, "includ": [1, 6, 7], "all": [1, 5, 6, 7, 14], "necessari": 1, "might": [1, 7], "give": [1, 7], "comput": [1, 7, 10], "hash": [1, 5], "everi": [1, 7, 14], "These": [1, 7], "lead_hash": 1, "geo": 1, "possibl": 1, "e": [1, 7], "g": [1, 7], "49": [1, 7], "123": [1, 7], "456789": 1, "number_countri": [1, 7], "countri": [1, 7], "germani": [1, 7], "number_area": [1, 7], "area": [1, 7], "berlin": 1, "number_valid": [1, 7], "number_poss": [1, 7], "phone_numb": 1, "phonenumb": [1, 7], "row": [1, 2, 7], "geograph": [1, 7], "demograph": [1, 7], "wa": [1, 7], "current": [1, 5, 7], "through": [1, 7], "py": [1, 7, 14], "merg": [1, 7], "geojson": 1, "case": [1, 6, 7], "problem": [1, 7], "25832": 1, "standard": [1, 7], "regionatla": 1, "pop_dens": 1, "popul": [1, 7], "densiti": [1, 7], "citi": [1, 7], "pop_develop": 1, "develop": [1, 7, 14], "age_0": 1, "ag": [1, 7], "group": [1, 5, 7], "18": [1, 7], "age_1": 1, "30": [1, 7, 10], "age_2": 1, "45": [1, 7], "age_3": 1, "60": [1, 7], "age_4": 1, "pop_avg_ag": 1, "per_service_sector": 1, "percentag": 1, "servic": [1, 7], "sector": 1, "per_trad": 1, "trade": 1, "employment_r": 1, "employ": [1, 7], "unemployment_r": 1, "unemploy": [1, 7], "per_long_term_unemploy": 1, "long": [1, 7], "term": [1, 7], "investments_p_employe": 1, "invest": [1, 7], "per": [1, 7], "employe": [1, 7], "gross_salary_p_employe": 1, "gross": [1, 7], "salari": [1, 7], "disp_income_p_inhabit": 1, "dispos": 1, "incom": [1, 7], "inhabit": [1, 7], "tot_income_p_taxpay": 1, "total": [1, 7], "taxpay": [1, 7], "gdp_p_employe": 1, "gdp": [1, 7], "gdp_develop": 1, "gdp_p_inhabit": 1, "gdp_p_workhour": 1, "workhour": [1, 7], "pop_avg_age_zensu": 1, "zensu": [1, 7], "regional_scor": 1, "region": [1, 7], "regional_atlas_pop_dens": [1, 7], "regional_atlas_pop_develop": [1, 7], "regional_atlas_age_0": [1, 7], "regional_atlas_age_1": [1, 7], "regional_atlas_age_2": [1, 7], "regional_atlas_age_3": [1, 7], "regional_atlas_age_4": [1, 7], "regional_atlas_pop_avg_ag": [1, 7], "regional_atlas_per_service_sector": [1, 7], "regional_atlas_per_trad": [1, 7], "regional_atlas_employment_r": [1, 7], "regional_atlas_unemployment_r": [1, 7], "regional_atlas_per_long_term_unemploy": [1, 7], "regional_atlas_investments_p_employe": [1, 7], "regional_atlas_gross_salary_p_employe": [1, 7], "regional_atlas_disp_income_p_inhabit": [1, 7], "regional_atlas_tot_income_p_taxpay": [1, 7], "regional_atlas_gdp_p_employe": [1, 7], "regional_atlas_gdp_develop": [1, 7], "regional_atlas_gdp_p_inhabit": [1, 7], "regional_atlas_gdp_p_workhour": [1, 7], "regional_atlas_pop_avg_age_zensu": [1, 7], "regional_atlas_regional_scor": [1, 7], "bui": 1, "power": [1, 7], "potenti": [1, 7], "million": 1, "euro": 1, "000": 1, "extens": 1, "ai0201": 1, "ai0202": 1, "ai0203": 1, "ai0204": 1, "ai0205": 1, "ai0206": 1, "ai0207": 1, "ai0218": 1, "ai0706": 1, "ai0707": 1, "ai0710": 1, "ai_z08": 1, "ai0808": 1, "ai1001": 1, "ai1002": 1, "ai1601": 1, "ai1602": 1, "ai1701": 1, "ai1702": 1, "ai1703": 1, "ai1704": 1, "ai_z01": 1, "featur": [1, 5], "centroid": 1, "more": [1, 7], "regional_atla": 1, "geodatafram": 1, "index": [1, 7, 9], "sale": [1, 2, 5, 6, 7], "qualif": 1, "relat": [1, 7], "readi": [1, 7], "cleanup": 1, "final": [1, 6, 7], "modifi": 1, "company_nam": 1, "offeneregist": [1, 7], "de": [1, 2, 7], "company_object": 1, "company_capit": 1, "capit": [1, 2], "company_capital_curr": 1, "currenc": [1, 2], "company_address": 1, "compan_address": 1, "abstract": [1, 5, 8], "parent": [1, 7], "enrich": [1, 5, 7], "sequenti": [1, 7], "collect": [1, 7], "alreadi": [1, 7], "forc": [1, 5], "_force_execut": 1, "properti": [1, 5], "home": [2, 5, 6], "runner": [2, 5, 6], "work": [2, 5, 6, 7, 14], "amos2023ws06": [2, 5, 6], "qualifi": [2, 5, 6], "src": [2, 5, 6, 7, 9, 14], "lead_data": 2, "data_fill_funct": 2, "callabl": 2, "step_nam": [2, 5], "fields_tofil": 2, "arg": [2, 8], "kwarg": [2, 8], "_find_from_positions_by_firstname_and_lastnam": 2, "last_nam": 2, "first_nam": 2, "posit": [2, 7], "tabl": [2, 5], "person": 2, "_find_row_by_companyid": 2, "company_id": 2, "_find_from_capital_by_companyid": 2, "_find_from_addresses_by_companyid": 2, "_find_from_objectives_by_companyid": 2, "_find_from_names_by_companyid": 2, "offerenregist": 2, "tupl": 2, "amount": [2, 7], "spell": 2, "detect": [2, 7], "en": [2, 7], "inp_text": 2, "option": [2, 5, 6, 7], "english": 2, "occur": 2, "max_retri": 2, "retri": 2, "3": [2, 8], "source_lang": 2, "auto": 2, "target": [2, 7], "submodul": [4, 12], "local_repositori": [4, 12], "localrepositori": [4, 5], "classification_report": [4, 5], "df_historical_output": [4, 5], "df_input": [4, 5], "df_output": [4, 5], "df_prediction_output": [4, 5], "df_preprocessed_input": [4, 5], "gpt_result": [4, 5], "ml_model": [4, 5], "snapshot": [4, 5], "clean_snapshot": [4, 5], "create_snapshot": [4, 5], "fetch_gpt_result": [4, 5], "fetch_review": [4, 5], "get_preprocessed_data_path": [4, 5], "insert_data": [4, 5], "load_classification_report": [4, 5], "load_lookup_t": [4, 5], "load_ml_model": [4, 5], "load_preprocessed_data": [4, 5], "save_classification_report": [4, 5], "save_datafram": [4, 5], "save_gpt_result": [4, 5], "save_lookup_t": [4, 5], "save_ml_model": [4, 5], "save_predict": [4, 5], "save_review": [4, 5], "repositori": [4, 7, 12, 14], "datetime_format": [4, 5], "get_datafram": [4, 5], "get_enriched_data_path": [4, 5], "get_input_path": [4, 5], "set_datafram": [4, 5], "s3_repositori": [4, 12], "s3repositori": [4, 5], "events_bucket": [4, 5], "features_bucket": [4, 5], "lookup_t": [4, 5], "models_bucket": [4, 5], "decode_s3_url": [4, 5], "get_databas": [4, 12], "100k_historic_enrich": 5, "sumup_leads_email": 5, "leads_enrich": 5, "leads_predicted_s": 5, "preprocessed_data_fil": 5, "after": [5, 7], "ran": 5, "successfulli": 5, "delet": [5, 7], "state": 5, "creat": [5, 6, 9], "belong": 5, "sing": [5, 7], "file_id": 5, "operation_nam": 5, "fetch": 5, "oper": [5, 7, 10, 14], "json": [5, 6, 7, 14], "desir": [5, 7], "histor": 5, "path": [5, 6, 7], "either": [5, 7], "todo": 5, "insert": 5, "new": [5, 7, 14], "must": [5, 7, 14], "model_nam": [5, 8], "classif": [5, 7], "lookup": [5, 7], "panda": 5, "ml": 5, "attribut": [5, 7, 10], "chosen": [5, 7, 14], "output": [5, 7], "save_d": 5, "date": [5, 7], "were": [5, 7], "upload": 5, "abc": [5, 8], "y": [5, 6, 7], "m": [5, 7, 8, 12], "d": [5, 10], "h": 5, "defin": 5, "refresh": 5, "event": [5, 7, 10], "historical_data": 5, "bucket": [5, 7], "get_int_input": [6, 12], "input_rang": 6, "integ": [6, 7], "displai": [6, 7], "valueerror": 6, "get_multiple_choic": [6, 12], "choic": [6, 7], "select": [6, 7], "enter": [6, 7], "invalid": [6, 8, 12], "get_string_input": [6, 12], "non": [6, 14], "sensit": [6, 7], "strip": 6, "space": [6, 7], "get_yes_no_input": [6, 12], "ye": 6, "n": [6, 7], "insensit": 6, "add_step_if_request": [6, 12], "step_class": 6, "step_desc": 6, "step_warning_messag": 6, "evp_demo": [6, 12], "pipeline_demo": [6, 12], "demonstr": [6, 7], "configur": [6, 7], "point": [6, 7], "predict_merchantsize_on_lead_data_demo": [6, 12], "predict_single_lead": [6, 12], "evp": [6, 9, 12], "estimatedvaluepredictor": [6, 8, 12], "preprocessing_demo": [6, 12], "test_evp_model": [6, 12], "get_all_available_pipeline_json_config": [6, 12], "config_path": 6, "pipeline_config": 6, "avail": 6, "config": [6, 7, 9, 12], "get_pipeline_additional_step": [6, 12], "copi": [6, 7, 14], "get_pipeline_config_from_json": [6, 12], "config_nam": 6, "default_pipeline_path": 6, "get_pipeline_initial_step": [6, 12], "initi": [6, 7], "get_pipeline_step": [6, 12], "both": [6, 7], "spdx": [7, 14], "licens": 7, "mit": [7, 14], "filecopyrighttext": [7, 14], "2023": [7, 9], "felix": [7, 14], "zailska": [7, 14], "env": [7, 14], "templat": [7, 14], "variabl": [7, 14], "applic": [7, 14], "root": [7, 14], "fill": [7, 14], "correspond": [7, 14], "To": [7, 14], "virtual": [7, 14], "your": [7, 14], "Then": [7, 14], "command": [7, 14], "dev": [7, 14], "product": [7, 14], "within": [7, 14], "now": [7, 14], "activ": [7, 14], "shell": [7, 14], "singl": [7, 14], "built": 7, "push": 7, "creation": 7, "github": 7, "action": 7, "For": [7, 14], "code": [7, 14], "style": 7, "flake8": 7, "directori": 7, "pytest": 7, "coverag": 7, "In": 7, "anoth": 7, "task": 7, "packag": [7, 9, 12, 14], "ensur": [7, 14], "doe": 7, "left": 7, "remain": 7, "open": 7, "free": 7, "block": 7, "until": 7, "fix": 7, "furthermor": 7, "hook": 7, "describ": 7, "here": 7, "uniform": 7, "throughout": 7, "compliant": [7, 14], "start": 7, "via": 7, "python": [7, 14], "2024": 7, "ahm": 7, "sheta": 7, "our": 7, "industri": 7, "partner": 7, "hand": 7, "effect": [7, 14], "increas": 7, "convers": 7, "primarili": 7, "team": 7, "modular": 7, "futur": 7, "proof": 7, "easi": 7, "add": [7, 10, 14], "emploi": 7, "predict": [7, 8, 12], "adjust": 7, "about": 7, "recent": 7, "leverag": 7, "learn": 7, "so": 7, "program": 7, "refer": 7, "md": 7, "choos": 7, "demo": [7, 9, 12], "util": 7, "want": 7, "pleas": [7, 14], "config_sprint09_releas": 7, "just_run_search_offeneregist": 7, "run_all_step": 7, "conigur": 7, "sprint": 7, "9": 7, "without": 7, "proce": 7, "subsequ": 7, "question": 7, "aris": 7, "scrape": 7, "take": 7, "cost": 7, "looong": 7, "regex": 7, "geocod": 7, "tri": 7, "emphas": 7, "depend": 7, "other": [7, 14], "exclud": 7, "issu": [7, 14], "enricht": 7, "ask": 7, "No": 7, "appli": 7, "certain": 7, "database_typ": 7, "order": 7, "post": 7, "crucial": 7, "involv": 7, "scale": 7, "numer": 7, "outlier": 7, "categor": 7, "hot": 7, "filter": 7, "out": [7, 10], "irrelev": 7, "couldn": 7, "t": 7, "dure": 7, "them": [7, 14], "would": 7, "avoid": [7, 14], "bia": 7, "introduc": 7, "even": 7, "pad": 7, "zero": 7, "show": 7, "where": 7, "preprocessed_data": 7, "six": 7, "random": [7, 8], "forest": [7, 8], "xgboost": [7, 8, 12], "naiv": [7, 8], "bay": [7, 8], "knn": [7, 8, 12], "adaboost": [7, 8, 12], "lightgbm": [7, 8, 12], "previous": 7, "x": [7, 8, 12], "l": [7, 8, 12], "xl": [7, 8, 12], "instead": 7, "label": 7, "alltogeth": 7, "worth": 7, "boost": 7, "while": 7, "small": 7, "trainig": 7, "dataset": 7, "mean": 7, "squar": 7, "submenu": 7, "essenc": 7, "li": 7, "forecast": 7, "unseen": 7, "gracefulli": 7, "simon": 7, "zimmermann": 7, "serv": 7, "pivot": 7, "esteem": 7, "sumup": 7, "pertain": 7, "garner": 7, "sign": 7, "refin": 7, "obtain": 7, "undergo": 7, "facilit": 7, "sophist": 7, "two": 7, "integr": 7, "submit": 7, "made": 7, "done": [7, 14], "wai": 7, "write": 7, "sheet": 7, "directli": 7, "salesforc": 7, "plai": 7, "role": 7, "sole": 7, "compris": 7, "fundament": 7, "encompass": 7, "recogn": 7, "insuffici": 7, "baselin": 7, "divers": 7, "incorpor": 7, "interfac": 7, "organis": 7, "extend": 7, "common": 7, "implement": 7, "statist": 7, "itself": 7, "inspect": 7, "analys": 7, "surround": 7, "atla": 7, "infer": 7, "phase": 7, "essenti": 7, "elimin": 7, "stage": 7, "transform": 7, "therebi": 7, "render": 7, "amen": 7, "primari": 7, "orient": 7, "toward": 7, "life": 7, "howev": 7, "evolv": 7, "progress": 7, "influenc": 7, "consider": 7, "therefor": 7, "chang": 7, "onli": [7, 14], "As": [7, 14], "consequ": 7, "somewhat": 7, "inconsist": 7, "context": 7, "aim": 7, "By": 7, "intend": 7, "assist": 7, "priorit": 7, "decis": 7, "contact": [7, 14], "approach": 7, "effici": 7, "optim": 7, "resourc": 7, "alloc": 7, "impact": 7, "proprietari": 7, "discern": 7, "discrimin": 7, "stratifi": 7, "taxonomi": 7, "imper": 7, "confidenti": 7, "underli": 7, "prohibit": 7, "its": 7, "public": 7, "disclosur": 7, "sophi": 7, "heasman": 7, "outlin": 7, "onlin": 7, "internet": 7, "most": 7, "http": 7, "www": 7, "com": 7, "kontaktieren": 7, "vertriebsteam": 7, "web": 7, "overview": 7, "platform": 7, "doc": 7, "meta": 7, "facebook": 7, "graph": 7, "highlight": 7, "acquisit": 7, "mai": 7, "deriv": 7, "exampl": 7, "mustermann": 7, "musternam": 7, "mustercompani": 7, "1234": 7, "56789": 7, "musteremail": 7, "symbol": 7, "organ": [7, 14], "host": 7, "written": 7, "49123456789": 7, "erlangen": 7, "weather": 7, "musterstr": 7, "100": [7, 8], "star": 7, "gave": 7, "same": 7, "musterwebsit": 7, "florist": 7, "2649": 7, "6": 7, "96": 7, "16": 7, "8": [7, 8, 10], "31": [7, 10], "26": 7, "17": 7, "7": 7, "42": [7, 8], "88": 7, "28": 7, "59": 7, "63": 7, "23703": 7, "84983": 7, "61845": 7, "41": 7, "3761": 7, "93": 7, "56": 7, "lucca": 7, "baumg\u00e4rtner": 7, "endpoint": 7, "enabl": 7, "best": 7, "chanc": 7, "combin": 7, "probabl": 7, "max": 7, "muster": 7, "491721234567": 7, "mybusi": 7, "melani": 7, "491322133321": 7, "flowershop": 7, "gmail": 7, "nl": 7, "fulltext": 7, "look": 7, "els": 7, "unless": 7, "full": 7, "everyth": 7, "those": 7, "noth": 7, "ruchita": 7, "nathani": 7, "llm": 7, "explor": 7, "crystalchat": 7, "hug": 7, "face": 7, "huggingfac": 7, "co": 7, "llm360": 7, "despit": 7, "capabl": 7, "intens": 7, "computation": 7, "heavi": 7, "cannot": 7, "infrastructur": 7, "constraint": 7, "colab": 7, "although": 7, "feasibl": 7, "gpu": 7, "altern": 7, "challeng": 7, "viabl": 7, "known": 7, "offer": 7, "unparallel": 7, "understand": 7, "associ": 7, "robust": 7, "acknowledg": 7, "experi": 7, "sagemak": 7, "due": 7, "dilig": 7, "evalu": 7, "achiev": 7, "advanc": 7, "suggest": 7, "comprehens": 7, "exactli": 7, "exact": [7, 14], "simplif": 7, "ofth": 7, "better": 7, "f1": 7, "across": 7, "accord": 7, "lunch": 7, "theorem": 7, "univers": 7, "superior": 7, "unfortun": 7, "did": 7, "satisfactorili": 7, "methodolgi": 7, "quadrat": 7, "vecotr": 7, "svm": 7, "fcnnc": 7, "fcnnr": 7, "k": 7, "nearest": 7, "neighbor": 7, "bernoulli": 7, "took": 7, "never": 7, "end": [7, 14], "believ": 7, "becaus": 7, "veri": 7, "misclassif": 7, "hard": 7, "minim": 7, "fcnn": 7, "lower": 7, "than": 7, "mainli": 7, "had": 7, "84": 7, "00": 7, "consist": [7, 14], "layer": 7, "relu": 7, "logit": 7, "softmax": 7, "loss": 7, "investig": 7, "cross": 7, "entropi": 7, "l2": 7, "adam": 7, "sctohast": 7, "gradient": 7, "descent": 7, "moreov": 7, "skip": 7, "l1": 7, "regular": 7, "techniqu": 7, "weight": [7, 8], "haven": 7, "outperform": 7, "simpler": 7, "There": 7, "scientif": 7, "paper": 7, "inter": 7, "speci": 7, "cell": 7, "pulmonari": 7, "hemosiderophag": 7, "equin": 7, "human": 7, "felin": 7, "specimen": 7, "marzahl": 7, "et": 7, "al": 7, "natur": 7, "articl": 7, "s41597": 7, "022": 7, "01389": 7, "thei": [7, 14], "wherea": 7, "contin": 7, "subject": 7, "threshhold": 7, "respectivli": 7, "yield": [7, 10], "still": 7, "wors": 7, "produc": 7, "satisfactori": 7, "15": 7, "reason": 7, "11": 7, "significantli": 7, "short": 7, "tabular": 7, "novel": 7, "commonli": 7, "encount": 7, "structur": 7, "titl": 7, "attent": 7, "interpret": 7, "arik": 7, "arxiv": 7, "org": 7, "ab": 7, "1908": 7, "07442": 7, "capac": 7, "salient": 7, "similarli": 7, "seem": 7, "respond": 7, "sub": 7, "section": 7, "discuss": 7, "arer": 7, "lot": 7, "54": 7, "addition": 7, "dimension": 7, "132": 7, "Not": 7, "equal": 7, "relev": 7, "decisiontre": 7, "distanc": [7, 8], "10": [7, 8, 10], "19": 7, "10000": 7, "round": 7, "2000": [7, 8], "leav": 7, "see": 7, "mark": 7, "bold": 7, "6314": 7, "6073": 7, "6150": 7, "6442": 7, "6098": 7, "6405": 7, "6725": 7, "6655": 7, "6642": 7, "6967": 7, "6523": 7, "6956": 7, "randomforest": [7, 8, 12], "6288": 7, "6075": 7, "5995": 7, "6198": 7, "6090": 7, "6252": 7, "6680": 7, "6506": 7, "6664": 7, "6591": 7, "6644": 7, "observ": 7, "slight": 7, "almost": 7, "compar": 7, "few": 7, "retain": 7, "enough": 7, "highli": 7, "82": 7, "83": 7, "81": 7, "77": 7, "02": 7, "13": 7, "22": 7, "14": 7, "08": 7, "09": 7, "06": 7, "07": 7, "05": 7, "21": 7, "78": 7, "04": 7, "similar": 7, "second": 7, "worst": 7, "again": 7, "mostli": 7, "decreas": 7, "27": 7, "33": [7, 10], "34": 7, "12": 7, "79": 7, "29": 7, "32": 7, "20": [7, 10], "slightli": 7, "interestingli": 7, "bare": 7, "affect": 7, "got": 7, "showcas": 7, "elev": 7, "overfit": 7, "emphasi": 7, "accur": 7, "recommend": 7, "yet": 7, "version": [7, 14], "carri": [7, 10], "conceptu": 7, "modul": [7, 9, 12], "pydant": 7, "plan": 7, "commun": 7, "devic": 7, "whenev": 7, "regist": [7, 14], "suppos": 7, "trigger": 7, "complet": 7, "back": 7, "rank": 7, "decid": 7, "queue": 7, "rout": 7, "asynchron": 7, "thread": 7, "librari": 7, "sdk": 7, "facebook_app_id": 7, "facebook_app_secret": 7, "owner": 7, "too": 7, "permiss": 7, "paramount": 7, "legal": 7, "ramif": 7, "kind": 7, "individu": 7, "privaci": 7, "regul": 7, "eu": 7, "earli": 7, "live": 7, "pars": 7, "site": 7, "pattern": 7, "precis": 7, "quit": 7, "accumul": 7, "faster": 7, "why": 7, "scrape_address": 7, "semant": 7, "practic": 7, "pollut": 7, "unnecessari": 7, "proper": 7, "cut": 7, "down": 7, "reduc": 7, "possibli": 7, "briefli": 7, "justifi": 7, "arbitrari": 7, "expand": 7, "qualiti": 7, "metric": 7, "regional_atlas_scor": 7, "google_confidence_scor": 7, "arbitrarili": 7, "promis": 7, "bozkurt": [7, 14], "beyond": 7, "prototyp": 7, "scenario": 7, "coordin": 7, "central": 7, "contrast": 7, "sever": 7, "interact": [7, 14], "unprocess": 7, "regard": 7, "unbias": 7, "twiiter": 7, "tweepi": 7, "purpos": 7, "shortfal": 7, "unavail": 7, "conduct": 7, "pose": 7, "embed": 7, "themselv": 7, "someth": 7, "like": 7, "help": 7, "deepli": 7, "impos": 7, "documentaion": 7, "stabl": 7, "under": [7, 10, 14], "epic": 7, "authent": 7, "registr": 7, "sampl": 7, "bugfix": 7, "bug": 7, "wrong": 7, "protect": 7, "against": 7, "direct": 7, "sd": 7, "approv": 7, "period": 7, "henc": 7, "git": 7, "easili": 7, "trace": 7, "manu": 7, "musterperson": 7, "alwai": [7, 14], "signoff": 7, "identif": 7, "pair": 7, "mention": 7, "clariti": 7, "author": 7, "fau": 7, "let": 7, "remot": 7, "checkout": 7, "don": 7, "forget": 7, "go": 7, "click": 7, "updat": 7, "photo": 7, "below": 7, "slack": 7, "await": 7, "wait": 7, "comment": 7, "warrant": 7, "onc": 7, "conflict": [7, 14], "solv": 7, "manual": 7, "resolv": 7, "editor": 7, "head": 7, "adopt": 7, "off": 7, "togeth": 7, "rather": 7, "alon": 7, "feel": 7, "announc": 7, "chat": 7, "remerg": 7, "shouldn": 7, "matter": 7, "pip": 7, "pipreq": 7, "cyclonedx": 7, "bom": 7, "import": 7, "r": 7, "pb": 7, "o": 7, "xmldocument": 7, "xml": 7, "loadxml": 7, "csvpath": 7, "arrai": 7, "iter": 7, "node": 7, "selectnod": 7, "foreach": 7, "_": 7, "purl": 7, "eq": 7, "scikit_learn": 7, "scikit": 7, "mix": 7, "convertfrom": 7, "pscustomobject": 7, "export": 7, "notypeinform": 7, "licensepath": 7, "cc": 7, "BY": 7, "fabian": 7, "paul": 7, "utech": 7, "f": 7, "gmx": 7, "net": 7, "filepath": 7, "move": 7, "wiki": 7, "favor": 7, "overlap": 7, "password": 7, "char": 7, "special": 7, "re": 7, "login": 7, "mfa": 7, "iam": 7, "access": 7, "info": 7, "firstnam": 7, "lastnam": 7, "credenti": 7, "scroll": 7, "accept": 7, "warn": 7, "tag": 7, "modif": 7, "creator": 7, "pingabl": 7, "seo": 7, "dn": 7, "datapoint": 7, "categori": 7, "visitor": 7, "revenu": 7, "recognit": 7, "imag": 7, "cafe": 7, "restaur": 7, "retail": 7, "etc": 7, "northdata": 7, "understodd": 7, "5000": 7, "month": 7, "bundesanzeig": 7, "handelsregist": 7, "deutschland": 7, "popular": 7, "insta": 7, "mayb": 7, "chatgpt": 7, "deal": 7, "profil": 7, "pdf": 7, "2307": 7, "10234": 7, "uniqu": 7, "frequent": 7, "layout": 7, "v": 7, "db": 7, "parquet": 7, "folder": 7, "hide": 7, "behind": 7, "listen": 7, "messagequeu": 7, "routingqueu": 7, "enqueu": 7, "idl": 7, "element": 7, "whole": 7, "multi": 7, "expect": 7, "becom": 7, "tree": 7, "na\u00efv": 7, "reduct": 7, "normal": [7, 12, 13], "dropout": 7, "nn": 7, "depth": 7, "width": 7, "xavier": 7, "he": 7, "sigmoid": 7, "lock": 7, "restart": 7, "pc": 7, "termin": 7, "window": 7, "workaround": 7, "bash": 7, "ubuntu": 7, "ignorestart": 7, "ignoreend": 7, "red": [7, 10, 12], "center": 7, "osmnx": 7, "rebas": 7, "train_siz": 8, "val_siz": 8, "test_siz": 8, "model_typ": 8, "limit_class": 8, "selected_featur": 8, "model_arg": 8, "lead_classifi": [8, 12], "classifi": [8, 9, 12], "merchantsizebydpv": [8, 12], "save_model": [8, 12], "train": [8, 12], "epoch": 8, "batch_siz": 8, "n_estim": 8, "class_weight": 8, "random_st": 8, "x_train": 8, "y_train": 8, "x_test": 8, "y_test": 8, "num_class": 8, "5": 8, "knnclassifi": [8, 12], "n_neighbor": 8, "num_leav": 8, "1000": 8, "enum": 8, "enumer": 8, "2": 8, "naivebayesclassifi": [8, 12], "naivebay": [8, 12], "xgb": [8, 12], "num_round": 8, "project": 9, "w": 9, "24": 9, "sum": 9, "logo": 9, "environ": 9, "build": 9, "connect": 9, "vision": 9, "mission": 9, "usag": 9, "design": 9, "introduct": 9, "strategi": [9, 13], "openllm": 9, "comparison": 9, "conclus": 9, "concept": 9, "unreal": 9, "idea": 9, "miscellan": 9, "unus": 9, "control": 9, "twitter": 9, "contribut": 9, "sbom": 9, "bdc": [9, 12], "logger": [9, 12], "page": 9, "log_dir": 10, "add_file_handl": [10, 12], "handler": 10, "disable_console_output": [10, 12], "disable_file_output": [10, 12], "enable_console_output": [10, 12], "enable_file_output": [10, 12], "has_console_handl": [10, 12], "has_file_handl": [10, 12], "fileoutformatt": [10, 12], "formatt": 10, "fmt": [10, 12], "asctim": 10, "levelnam": 10, "filenam": 10, "lineno": 10, "record": 10, "operand": 10, "coupl": 10, "preparatori": 10, "logrecord": 10, "getmessag": 10, "usestim": 10, "formattim": 10, "formatexcept": 10, "append": 10, "stdoutformatt": [10, 12], "x1b": 10, "38": 10, "20m": 10, "0m": 10, "34m": 10, "40": 10, "50": 10, "1m": 10, "blue": [10, 12], "bold_r": [10, 12], "grei": [10, 12], "reset": [10, 12], "yellow": [10, 12], "get_logg": [10, 12], "subpackag": 12, "content": 12, "console_util": 12, "pipeline_util": 12, "predictor": 12, "class_label_encod": [12, 13], "fill_missing_valu": [12, 13], "filter_out_null_data": [12, 13], "implement_preprocessing_pipelin": [12, 13], "min_max_sc": [12, 13], "multiple_label_encod": [12, 13], "remove_outliers_zscor": [12, 13], "robust_sc": [12, 13], "save_preprocessed_data": [12, 13], "single_one_hot_encod": [12, 13], "standard_sc": [12, 13], "filter_null_data": 13, "historical_bool": 13, "constant": 13, "berkai": 14, "need": 14, "pipenv": 14, "instal": 14, "machin": 14, "pipfil": 14, "pin": 14, "unexpect": 14, "side": 14, "upgrad": 14, "package_nam": 14, "version_numb": 14, "note": 14, "permit": 14, "copyleft": 14, "awar": 14, "yourself": 14, "blindli": 14, "docker": 14, "dockerfil": 14, "deploy": 14, "afterward": 14, "entrypoint": 14, "daemon": 14, "build_app": 14, "sh": 14, "run_app": 14, "compos": 14, "sumup_app": 14, "reus": 14, "copyright": 14, "declar": 14, "document": 14, "each": 14, "thing": 14, "automat": 14, "black": 14, "isort": 14, "prettier": 14, "syntax": 14, "yaml": 14, "trail": 14, "whitespac": 14, "prevent": 14, "branch": 14, "adher": 14}, "objects": {"": [[0, 0, 0, "-", "bdc"], [3, 0, 0, "-", "config"], [4, 0, 0, "-", "database"], [6, 0, 0, "-", "demo"], [8, 0, 0, "-", "evp"], [10, 0, 0, "-", "logger"], [11, 0, 0, "-", "main"], [13, 0, 0, "-", "preprocessing"]], "bdc": [[0, 0, 0, "-", "pipeline"], [1, 0, 0, "-", "steps"]], "bdc.pipeline": [[0, 1, 1, "", "Pipeline"]], "bdc.pipeline.Pipeline": [[0, 2, 1, "", "run"]], "bdc.steps": [[1, 0, 0, "-", "analyze_emails"], [1, 0, 0, "-", "analyze_reviews"], [1, 0, 0, "-", "google_places"], [1, 0, 0, "-", "google_places_detailed"], [1, 0, 0, "-", "gpt_summarizer"], [1, 0, 0, "-", "hash_generator"], [2, 0, 0, "-", "helpers"], [1, 0, 0, "-", "preprocess_phonenumbers"], [1, 0, 0, "-", "regionalatlas"], [1, 0, 0, "-", "search_offeneregister"], [1, 0, 0, "-", "step"]], "bdc.steps.analyze_emails": [[1, 1, 1, "", "AnalyzeEmails"], [1, 4, 1, "", "analyze_email_account"], [1, 4, 1, "", "extract_custom_domain"]], "bdc.steps.analyze_emails.AnalyzeEmails": [[1, 3, 1, "id0", "added_cols"], [1, 2, 1, "", "finish"], [1, 2, 1, "", "load_data"], [1, 3, 1, "id1", "name"], [1, 3, 1, "id2", "required_cols"], [1, 2, 1, "", "run"], [1, 2, 1, "", "verify"]], "bdc.steps.analyze_reviews": [[1, 1, 1, "", "GPTReviewSentimentAnalyzer"], [1, 1, 1, "", "SmartReviewInsightsEnhancer"], [1, 4, 1, "", "check_api_key"], [1, 4, 1, "", "is_review_valid"], [1, 5, 1, "", "log"]], "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer": [[1, 3, 1, "id3", "MAX_PROMPT_TOKENS"], [1, 3, 1, "id4", "added_cols"], [1, 2, 1, "id5", "batch_reviews"], [1, 2, 1, "id6", "extract_text_from_reviews"], [1, 3, 1, "id7", "extracted_col_name"], [1, 2, 1, "id8", "finish"], [1, 3, 1, "id9", "gpt"], [1, 2, 1, "", "gpt_calculate_avg_sentiment_score"], [1, 3, 1, "id10", "gpt_required_fields"], [1, 2, 1, "id11", "gpt_sentiment_analyze_review"], [1, 2, 1, "id12", "load_data"], [1, 3, 1, "id13", "model"], [1, 3, 1, "id14", "model_encoding_name"], [1, 3, 1, "id15", "name"], [1, 3, 1, "id16", "no_answer"], [1, 2, 1, "id17", "num_tokens_from_string"], [1, 3, 1, "", "required_cols"], [1, 2, 1, "id18", "run"], [1, 2, 1, "id19", "run_sentiment_analysis"], [1, 3, 1, "id20", "system_message_for_sentiment_analysis"], [1, 3, 1, "", "text_analyzer"], [1, 2, 1, "", "textblob_calculate_avg_sentiment_score"], [1, 3, 1, "id21", "user_message_for_sentiment_analysis"], [1, 2, 1, "id22", "verify"]], "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer": [[1, 3, 1, "id23", "MIN_RATINGS_COUNT"], [1, 3, 1, "id24", "RATING_DOMINANCE_THRESHOLD"], [1, 2, 1, "", "_analyze_rating_trend"], [1, 2, 1, "", "_calculate_average_grammatical_score"], [1, 2, 1, "", "_calculate_score"], [1, 2, 1, "", "_determine_polarization_type"], [1, 2, 1, "", "_enhance_review_insights"], [1, 2, 1, "", "_get_language_tool"], [1, 2, 1, "", "_grammatical_errors"], [1, 2, 1, "", "_quantify_polarization"], [1, 3, 1, "id25", "added_cols"], [1, 2, 1, "id26", "finish"], [1, 3, 1, "", "language_tools"], [1, 2, 1, "id27", "load_data"], [1, 3, 1, "id28", "name"], [1, 3, 1, "id29", "required_fields"], [1, 2, 1, "id30", "run"], [1, 3, 1, "", "text_analyzer"], [1, 2, 1, "id31", "verify"]], "bdc.steps.google_places": [[1, 1, 1, "", "GooglePlaces"]], "bdc.steps.google_places.GooglePlaces": [[1, 3, 1, "id32", "added_cols"], [1, 3, 1, "", "api_fields"], [1, 2, 1, "", "calculate_confidence"], [1, 3, 1, "", "df_fields"], [1, 2, 1, "", "finish"], [1, 2, 1, "", "get_data_from_google_api"], [1, 2, 1, "", "get_first_place_candidate"], [1, 3, 1, "", "gmaps"], [1, 2, 1, "", "load_data"], [1, 3, 1, "id33", "name"], [1, 3, 1, "id34", "required_cols"], [1, 2, 1, "", "run"], [1, 2, 1, "", "verify"]], "bdc.steps.google_places_detailed": [[1, 1, 1, "", "GooglePlacesDetailed"]], "bdc.steps.google_places_detailed.GooglePlacesDetailed": [[1, 3, 1, "id35", "added_cols"], [1, 3, 1, "", "api_fields"], [1, 3, 1, "", "api_fields_output"], [1, 3, 1, "", "df_fields"], [1, 2, 1, "", "finish"], [1, 2, 1, "", "get_data_from_detailed_google_api"], [1, 3, 1, "", "gmaps"], [1, 2, 1, "", "load_data"], [1, 3, 1, "id36", "name"], [1, 3, 1, "id37", "required_cols"], [1, 2, 1, "", "run"], [1, 2, 1, "", "verify"]], "bdc.steps.gpt_summarizer": [[1, 1, 1, "", "GPTSummarizer"]], "bdc.steps.gpt_summarizer.GPTSummarizer": [[1, 3, 1, "id38", "added_cols"], [1, 3, 1, "", "client"], [1, 2, 1, "", "extract_the_raw_html_and_parse"], [1, 3, 1, "", "extracted_col_name_website_summary"], [1, 2, 1, "", "finish"], [1, 3, 1, "", "gpt_required_fields"], [1, 2, 1, "", "load_data"], [1, 3, 1, "", "model"], [1, 3, 1, "id39", "name"], [1, 3, 1, "", "no_answer"], [1, 3, 1, "id40", "required_cols"], [1, 2, 1, "", "run"], [1, 2, 1, "", "summarize_the_company_website"], [1, 3, 1, "", "system_message_for_website_summary"], [1, 3, 1, "", "user_message_for_website_summary"], [1, 2, 1, "", "verify"]], "bdc.steps.hash_generator": [[1, 1, 1, "", "HashGenerator"]], "bdc.steps.hash_generator.HashGenerator": [[1, 3, 1, "id41", "added_cols"], [1, 2, 1, "", "finish"], [1, 2, 1, "", "load_data"], [1, 3, 1, "id42", "name"], [1, 3, 1, "id43", "required_cols"], [1, 2, 1, "", "run"], [1, 2, 1, "", "verify"]], "bdc.steps.helpers": [[2, 0, 0, "-", "generate_hash_leads"], [2, 4, 1, "", "get_lead_hash_generator"], [2, 0, 0, "-", "offeneregister_api"], [2, 0, 0, "-", "text_analyzer"]], "bdc.steps.helpers.generate_hash_leads": [[2, 1, 1, "", "LeadHashGenerator"]], "bdc.steps.helpers.generate_hash_leads.LeadHashGenerator": [[2, 3, 1, "", "BASE_PATH"], [2, 2, 1, "", "hash_check"], [2, 2, 1, "", "hash_lead"]], "bdc.steps.helpers.offeneregister_api": [[2, 1, 1, "", "OffeneRegisterAPI"]], "bdc.steps.helpers.offeneregister_api.OffeneRegisterAPI": [[2, 2, 1, "", "find_companyAddress_by_lastName_firstName"], [2, 2, 1, "", "find_companyCapitals_by_lastName_firstName"], [2, 2, 1, "", "find_companyName_by_lastName_firstName"], [2, 2, 1, "", "find_companyObjective_by_lastName_firstName"]], "bdc.steps.helpers.text_analyzer": [[2, 1, 1, "", "TextAnalyzer"]], "bdc.steps.helpers.text_analyzer.TextAnalyzer": [[2, 3, 1, "", "TARGET_LANG"], [2, 2, 1, "", "calculate_sentiment_analysis_score"], [2, 2, 1, "", "correct_text"], [2, 2, 1, "", "find_number_of_grammatical_errors"], [2, 2, 1, "", "find_number_of_spelling_errors"], [2, 2, 1, "", "find_spelling_errors"], [2, 2, 1, "", "translate"]], "bdc.steps.preprocess_phonenumbers": [[1, 1, 1, "", "PreprocessPhonenumbers"]], "bdc.steps.preprocess_phonenumbers.PreprocessPhonenumbers": [[1, 3, 1, "id44", "added_cols"], [1, 2, 1, "", "check_number"], [1, 2, 1, "", "finish"], [1, 2, 1, "", "load_data"], [1, 3, 1, "id45", "name"], [1, 2, 1, "", "process_row"], [1, 3, 1, "id46", "required_cols"], [1, 2, 1, "", "run"], [1, 2, 1, "", "verify"]], "bdc.steps.regionalatlas": [[1, 1, 1, "", "RegionalAtlas"]], "bdc.steps.regionalatlas.RegionalAtlas": [[1, 3, 1, "id47", "added_cols"], [1, 2, 1, "", "calculate_regional_score"], [1, 3, 1, "id48", "df_fields"], [1, 3, 1, "id49", "empty_result"], [1, 3, 1, "id50", "epsg_code_etrs"], [1, 2, 1, "", "finish"], [1, 2, 1, "", "get_data_from_address"], [1, 2, 1, "", "load_data"], [1, 3, 1, "id51", "name"], [1, 3, 1, "id52", "reagionalatlas_feature_keys"], [1, 3, 1, "id53", "regions_gdfs"], [1, 3, 1, "id54", "required_cols"], [1, 2, 1, "", "run"], [1, 2, 1, "", "verify"]], "bdc.steps.search_offeneregister": [[1, 1, 1, "", "SearchOffeneRegister"]], "bdc.steps.search_offeneregister.SearchOffeneRegister": [[1, 2, 1, "", "_extract_company_related_data"], [1, 3, 1, "id55", "added_cols"], [1, 2, 1, "id56", "finish"], [1, 2, 1, "id57", "load_data"], [1, 3, 1, "id58", "name"], [1, 3, 1, "id59", "offeneregisterAPI"], [1, 3, 1, "id60", "required_cols"], [1, 2, 1, "id61", "run"], [1, 2, 1, "id62", "verify"]], "bdc.steps.step": [[1, 1, 1, "", "Step"], [1, 7, 1, "", "StepError"]], "bdc.steps.step.Step": [[1, 3, 1, "id63", "added_cols"], [1, 2, 1, "", "check_data_presence"], [1, 6, 1, "", "df"], [1, 2, 1, "", "finish"], [1, 2, 1, "", "load_data"], [1, 3, 1, "id64", "name"], [1, 3, 1, "id65", "required_cols"], [1, 2, 1, "", "run"], [1, 2, 1, "", "verify"]], "database": [[4, 4, 1, "", "get_database"], [5, 0, 0, "-", "leads"]], "database.leads": [[5, 0, 0, "-", "local_repository"], [5, 0, 0, "-", "repository"], [5, 0, 0, "-", "s3_repository"]], "database.leads.local_repository": [[5, 1, 1, "", "LocalRepository"]], "database.leads.local_repository.LocalRepository": [[5, 3, 1, "", "BASE_PATH"], [5, 3, 1, "", "CLASSIFICATION_REPORTS"], [5, 3, 1, "", "DF_HISTORICAL_OUTPUT"], [5, 3, 1, "", "DF_INPUT"], [5, 3, 1, "", "DF_OUTPUT"], [5, 3, 1, "", "DF_PREDICTION_OUTPUT"], [5, 3, 1, "", "DF_PREPROCESSED_INPUT"], [5, 3, 1, "", "GPT_RESULTS"], [5, 3, 1, "", "ML_MODELS"], [5, 3, 1, "", "REVIEWS"], [5, 3, 1, "", "SNAPSHOTS"], [5, 2, 1, "", "clean_snapshots"], [5, 2, 1, "", "create_snapshot"], [5, 2, 1, "", "fetch_gpt_result"], [5, 2, 1, "", "fetch_review"], [5, 2, 1, "", "get_preprocessed_data_path"], [5, 2, 1, "", "insert_data"], [5, 2, 1, "", "load_classification_report"], [5, 2, 1, "", "load_lookup_table"], [5, 2, 1, "", "load_ml_model"], [5, 2, 1, "", "load_preprocessed_data"], [5, 2, 1, "", "save_classification_report"], [5, 2, 1, "", "save_dataframe"], [5, 2, 1, "", "save_gpt_result"], [5, 2, 1, "", "save_lookup_table"], [5, 2, 1, "", "save_ml_model"], [5, 2, 1, "", "save_prediction"], [5, 2, 1, "", "save_review"]], "database.leads.repository": [[5, 1, 1, "", "Repository"]], "database.leads.repository.Repository": [[5, 3, 1, "", "DATETIME_FORMAT"], [5, 6, 1, "", "DF_HISTORICAL_OUTPUT"], [5, 6, 1, "", "DF_INPUT"], [5, 6, 1, "", "DF_OUTPUT"], [5, 6, 1, "", "GPT_RESULTS"], [5, 6, 1, "", "REVIEWS"], [5, 6, 1, "", "SNAPSHOTS"], [5, 2, 1, "", "clean_snapshots"], [5, 2, 1, "", "create_snapshot"], [5, 2, 1, "", "fetch_gpt_result"], [5, 2, 1, "", "fetch_review"], [5, 2, 1, "", "get_dataframe"], [5, 2, 1, "", "get_enriched_data_path"], [5, 2, 1, "", "get_input_path"], [5, 2, 1, "", "get_preprocessed_data_path"], [5, 2, 1, "", "insert_data"], [5, 2, 1, "", "load_classification_report"], [5, 2, 1, "", "load_lookup_table"], [5, 2, 1, "", "load_ml_model"], [5, 2, 1, "", "load_preprocessed_data"], [5, 2, 1, "", "save_classification_report"], [5, 2, 1, "", "save_dataframe"], [5, 2, 1, "", "save_gpt_result"], [5, 2, 1, "", "save_lookup_table"], [5, 2, 1, "", "save_ml_model"], [5, 2, 1, "", "save_prediction"], [5, 2, 1, "", "save_review"], [5, 2, 1, "", "set_dataframe"]], "database.leads.s3_repository": [[5, 1, 1, "", "S3Repository"], [5, 4, 1, "", "decode_s3_url"]], "database.leads.s3_repository.S3Repository": [[5, 3, 1, "", "CLASSIFICATION_REPORTS"], [5, 3, 1, "", "DF_HISTORICAL_OUTPUT"], [5, 3, 1, "", "DF_INPUT"], [5, 3, 1, "", "DF_OUTPUT"], [5, 3, 1, "", "DF_PREDICTION_OUTPUT"], [5, 3, 1, "", "DF_PREPROCESSED_INPUT"], [5, 3, 1, "", "EVENTS_BUCKET"], [5, 3, 1, "", "FEATURES_BUCKET"], [5, 3, 1, "", "GPT_RESULTS"], [5, 3, 1, "", "LOOKUP_TABLES"], [5, 3, 1, "", "ML_MODELS"], [5, 3, 1, "", "MODELS_BUCKET"], [5, 3, 1, "", "REVIEWS"], [5, 3, 1, "", "SNAPSHOTS"], [5, 2, 1, "", "clean_snapshots"], [5, 2, 1, "", "create_snapshot"], [5, 2, 1, "", "fetch_gpt_result"], [5, 2, 1, "", "fetch_review"], [5, 2, 1, "", "get_preprocessed_data_path"], [5, 2, 1, "", "insert_data"], [5, 2, 1, "", "load_classification_report"], [5, 2, 1, "", "load_lookup_table"], [5, 2, 1, "", "load_ml_model"], [5, 2, 1, "", "load_preprocessed_data"], [5, 2, 1, "", "save_classification_report"], [5, 2, 1, "", "save_dataframe"], [5, 2, 1, "", "save_gpt_result"], [5, 2, 1, "", "save_lookup_table"], [5, 2, 1, "", "save_ml_model"], [5, 2, 1, "", "save_prediction"], [5, 2, 1, "", "save_review"]], "demo": [[6, 0, 0, "-", "console_utils"], [6, 0, 0, "-", "demos"], [6, 0, 0, "-", "pipeline_utils"]], "demo.console_utils": [[6, 4, 1, "", "get_int_input"], [6, 4, 1, "", "get_multiple_choice"], [6, 4, 1, "", "get_string_input"], [6, 4, 1, "", "get_yes_no_input"]], "demo.demos": [[6, 4, 1, "", "add_step_if_requested"], [6, 4, 1, "", "evp_demo"], [6, 4, 1, "", "pipeline_demo"], [6, 4, 1, "", "predict_MerchantSize_on_lead_data_demo"], [6, 4, 1, "", "predict_single_lead"], [6, 4, 1, "", "preprocessing_demo"], [6, 4, 1, "", "test_evp_model"]], "demo.pipeline_utils": [[6, 4, 1, "", "get_all_available_pipeline_json_configs"], [6, 4, 1, "", "get_pipeline_additional_steps"], [6, 4, 1, "", "get_pipeline_config_from_json"], [6, 4, 1, "", "get_pipeline_initial_steps"], [6, 4, 1, "", "get_pipeline_steps"]], "evp": [[8, 0, 0, "-", "evp"], [8, 0, 0, "-", "predictors"]], "evp.evp": [[8, 1, 1, "", "EstimatedValuePredictor"]], "evp.evp.EstimatedValuePredictor": [[8, 3, 1, "", "lead_classifier"], [8, 2, 1, "", "predict"], [8, 2, 1, "", "save_model"], [8, 2, 1, "", "train"]], "evp.predictors": [[8, 1, 1, "", "AdaBoost"], [8, 1, 1, "", "Classifier"], [8, 1, 1, "", "KNNClassifier"], [8, 1, 1, "", "LightGBM"], [8, 1, 1, "", "MerchantSizeByDPV"], [8, 1, 1, "", "NaiveBayesClassifier"], [8, 1, 1, "", "Predictors"], [8, 1, 1, "", "RandomForest"], [8, 1, 1, "", "XGB"]], "evp.predictors.AdaBoost": [[8, 2, 1, "", "predict"], [8, 2, 1, "", "train"]], "evp.predictors.Classifier": [[8, 2, 1, "", "load"], [8, 2, 1, "", "predict"], [8, 2, 1, "", "save"], [8, 2, 1, "", "train"]], "evp.predictors.KNNClassifier": [[8, 2, 1, "", "predict"], [8, 2, 1, "", "train"]], "evp.predictors.LightGBM": [[8, 2, 1, "", "predict"], [8, 2, 1, "", "train"]], "evp.predictors.MerchantSizeByDPV": [[8, 3, 1, "", "Invalid"], [8, 3, 1, "", "L"], [8, 3, 1, "", "M"], [8, 3, 1, "", "S"], [8, 3, 1, "", "XL"], [8, 3, 1, "", "XS"]], "evp.predictors.NaiveBayesClassifier": [[8, 2, 1, "", "predict"], [8, 2, 1, "", "train"]], "evp.predictors.Predictors": [[8, 3, 1, "", "AdaBoost"], [8, 3, 1, "", "KNN"], [8, 3, 1, "", "LightGBM"], [8, 3, 1, "", "NaiveBayes"], [8, 3, 1, "", "RandomForest"], [8, 3, 1, "", "XGBoost"]], "evp.predictors.RandomForest": [[8, 2, 1, "", "predict"], [8, 2, 1, "", "train"]], "evp.predictors.XGB": [[8, 2, 1, "", "predict"], [8, 2, 1, "", "train"]], "logger": [[10, 4, 1, "", "get_logger"], [10, 0, 0, "-", "logger"]], "logger.logger": [[10, 1, 1, "", "CustomLogger"], [10, 1, 1, "", "FileOutFormatter"], [10, 1, 1, "", "StdOutFormatter"]], "logger.logger.CustomLogger": [[10, 2, 1, "", "add_file_handler"], [10, 2, 1, "", "disable_console_output"], [10, 2, 1, "", "disable_file_output"], [10, 2, 1, "", "enable_console_output"], [10, 2, 1, "", "enable_file_output"], [10, 2, 1, "", "has_console_handler"], [10, 2, 1, "", "has_file_handler"]], "logger.logger.FileOutFormatter": [[10, 3, 1, "", "fmt"], [10, 2, 1, "", "format"]], "logger.logger.StdOutFormatter": [[10, 3, 1, "", "FORMATS"], [10, 3, 1, "", "blue"], [10, 3, 1, "", "bold_red"], [10, 3, 1, "", "fmt"], [10, 2, 1, "", "format"], [10, 3, 1, "", "grey"], [10, 3, 1, "", "red"], [10, 3, 1, "", "reset"], [10, 3, 1, "", "yellow"]], "preprocessing": [[13, 0, 0, "-", "preprocessing"]], "preprocessing.preprocessing": [[13, 1, 1, "", "Preprocessing"]], "preprocessing.preprocessing.Preprocessing": [[13, 2, 1, "", "class_label_encoding"], [13, 2, 1, "", "fill_missing_values"], [13, 2, 1, "", "filter_out_null_data"], [13, 2, 1, "", "implement_preprocessing_pipeline"], [13, 2, 1, "", "min_max_scaling"], [13, 2, 1, "", "multiple_label_encoding"], [13, 2, 1, "", "normalization"], [13, 2, 1, "", "remove_outliers_zscore"], [13, 2, 1, "", "robust_scaling"], [13, 2, 1, "", "save_preprocessed_data"], [13, 2, 1, "", "single_one_hot_encoding"], [13, 2, 1, "", "standard_scaling"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:method", "3": "py:attribute", "4": "py:function", "5": "py:data", "6": "py:property", "7": "py:exception"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "method", "Python method"], "3": ["py", "attribute", "Python attribute"], "4": ["py", "function", "Python function"], "5": ["py", "data", "Python data"], "6": ["py", "property", "Python property"], "7": ["py", "exception", "Python exception"]}, "titleterms": {"bdc": [0, 1, 2, 7], "packag": [0, 1, 2, 4, 5, 6, 8, 10, 13], "subpackag": [0, 1, 4], "submodul": [0, 1, 2, 5, 6, 8, 10, 13], "pipelin": [0, 7], "modul": [0, 1, 2, 3, 4, 5, 6, 8, 10, 11, 13], "content": [0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 13], "step": [1, 2], "analyze_email": 1, "analyze_review": 1, "google_plac": 1, "google_places_detail": 1, "gpt_summar": 1, "hash_gener": 1, "preprocess_phonenumb": 1, "regionalatla": 1, "search_offeneregist": 1, "helper": 2, "generate_hash_lead": 2, "offeneregister_api": 2, "text_analyz": 2, "config": 3, "databas": [4, 5, 14], "lead": [5, 7, 9, 14], "local_repositori": 5, "repositori": 5, "s3_repositori": 5, "demo": 6, "console_util": 6, "pipeline_util": 6, "build": [7, 14], "document": [7, 9], "creat": [7, 14], "environ": [7, 14], "process": [7, 14], "run": 7, "app": 7, "user": 7, "project": [7, 14], "vision": 7, "mission": 7, "usag": 7, "0": 7, "base": 7, "data": 7, "collector": 7, "1": 7, "preprocess": [7, 13], "2": 7, "ml": 7, "model": 7, "train": 7, "3": 7, "merchant": 7, "size": 7, "predictor": [7, 8], "4": 7, "exit": 7, "design": 7, "introduct": 7, "compon": 7, "diagram": 7, "extern": 7, "softwar": 7, "form": 7, "lf": 7, "custom": 7, "relationship": 7, "manag": 7, "crm": 7, "gener": 7, "descript": 7, "storag": 7, "msp": 7, "estim": 7, "valu": 7, "evp": [7, 8], "histor": 7, "note": 7, "field": 7, "definit": 7, "tabl": [7, 9], "link": 7, "sourc": 7, "csv": 7, "googl": 7, "search": 7, "strategi": 7, "avail": 7, "inform": 7, "method": 7, "openllm": 7, "busi": 7, "type": 7, "analysi": 7, "research": 7, "propos": 7, "solut": 7, "conclus": 7, "classifi": 7, "comparison": 7, "abstract": 7, "experiment": 7, "attempt": 7, "perform": 7, "well": 7, "support": 7, "vector": 7, "machin": 7, "fulli": 7, "connect": [7, 14], "neural": 7, "network": 7, "regress": 7, "qda": 7, "ridg": 7, "tabnet": 7, "architectur": 7, "featur": 7, "subset": 7, "overal": 7, "result": 7, "each": 7, "class": 7, "5": 7, "split": 7, "concept": 7, "unreal": 7, "idea": 7, "miscellan": 7, "unus": 7, "deprec": 7, "control": 7, "facebookgraphapi": 7, "scrapeaddress": 7, "possibl": 7, "improv": 7, "autom": 7, "sequenc": 7, "workflow": 7, "twitter": 7, "api": 7, "limit": 7, "retriev": 7, "bias": 7, "sentiment": 7, "absenc": 7, "usernam": 7, "provid": 7, "inher": 7, "tweet": 7, "": [7, 9], "contribut": 7, "branch": 7, "commit": [7, 14], "pull": 7, "request": 7, "sbom": 7, "automat": 7, "knowledg": 7, "aw": 7, "pr": 7, "pre": [7, 14], "flow": 7, "berkai": 7, "ai": 7, "what": 7, "do": 7, "we": 7, "need": 7, "troubleshoot": 7, "pipenv": 7, "instal": 7, "stuck": 7, "docker": 7, "vscode": 7, "test": 7, "reus": 7, "fail": 7, "check": 7, "place": 7, "diverg": 7, "welcom": 9, "sale": [9, 14], "qualifi": [9, 14], "indic": 9, "logger": 10, "main": 11, "src": 12, "amo": 14, "w": 14, "2023": 14, "24": 14, "sum": 14, "insight": 14, "logo": 14, "licens": 14, "hook": 14}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1, "sphinx": 60}, "alltitles": {"bdc package": [[0, "bdc-package"]], "Subpackages": [[0, "subpackages"], [1, "subpackages"], [4, "subpackages"]], "Submodules": [[0, "submodules"], [1, "submodules"], [2, "submodules"], [5, "submodules"], [6, "submodules"], [8, "submodules"], [10, "submodules"], [13, "submodules"]], "bdc.pipeline module": [[0, "module-bdc.pipeline"]], "Module contents": [[0, "module-bdc"], [1, "module-bdc.steps"], [2, "module-bdc.steps.helpers"], [4, "module-database"], [5, "module-database.leads"], [6, "module-demo"], [8, "module-evp"], [10, "module-logger"], [13, "module-preprocessing"]], "bdc.steps package": [[1, "bdc-steps-package"]], "bdc.steps.analyze_emails module": [[1, "module-bdc.steps.analyze_emails"]], "bdc.steps.analyze_reviews module": [[1, "module-bdc.steps.analyze_reviews"]], "bdc.steps.google_places module": [[1, "module-bdc.steps.google_places"]], "bdc.steps.google_places_detailed module": [[1, "module-bdc.steps.google_places_detailed"]], "bdc.steps.gpt_summarizer module": [[1, "module-bdc.steps.gpt_summarizer"]], "bdc.steps.hash_generator module": [[1, "module-bdc.steps.hash_generator"]], "bdc.steps.preprocess_phonenumbers module": [[1, "module-bdc.steps.preprocess_phonenumbers"]], "bdc.steps.regionalatlas module": [[1, "module-bdc.steps.regionalatlas"]], "bdc.steps.search_offeneregister module": [[1, "module-bdc.steps.search_offeneregister"]], "bdc.steps.step module": [[1, "module-bdc.steps.step"]], "bdc.steps.helpers package": [[2, "bdc-steps-helpers-package"]], "bdc.steps.helpers.generate_hash_leads module": [[2, "module-bdc.steps.helpers.generate_hash_leads"]], "bdc.steps.helpers.offeneregister_api module": [[2, "module-bdc.steps.helpers.offeneregister_api"]], "bdc.steps.helpers.text_analyzer module": [[2, "module-bdc.steps.helpers.text_analyzer"]], "config module": [[3, "module-config"]], "database package": [[4, "database-package"]], "database.leads package": [[5, "database-leads-package"]], "database.leads.local_repository module": [[5, "module-database.leads.local_repository"]], "database.leads.repository module": [[5, "module-database.leads.repository"]], "database.leads.s3_repository module": [[5, "module-database.leads.s3_repository"]], "demo package": [[6, "demo-package"]], "demo.console_utils module": [[6, "module-demo.console_utils"]], "demo.demos module": [[6, "module-demo.demos"]], "demo.pipeline_utils module": [[6, "module-demo.pipeline_utils"]], "Build Documentation": [[7, "build-documentation"]], "Creating the Environment": [[7, "creating-the-environment"], [14, "creating-the-environment"]], "Build Process": [[7, "build-process"], [14, "build-process"]], "Running the app": [[7, "running-the-app"]], "User Documentation": [[7, "user-documentation"]], "Project vision": [[7, "project-vision"]], "Project mission": [[7, "project-mission"]], "Usage": [[7, "usage"]], "(0) : Base Data Collector": [[7, "base-data-collector"]], "(1) : Data preprocessing": [[7, "data-preprocessing"]], "(2) : ML model training": [[7, "ml-model-training"]], "(3) : Merchant Size Predictor": [[7, "merchant-size-predictor"]], "(4) : Exit": [[7, "exit"]], "Design Documentation": [[7, "design-documentation"]], "Introduction": [[7, "introduction"], [7, "introduction"]], "Component Diagram": [[7, "component-diagram"], [7, "component-diagram"]], "External Software": [[7, "external-software"]], "Lead Form (LF)": [[7, "lead-form-lf"]], "Customer Relationship Management (CRM)": [[7, "customer-relationship-management-crm"]], "Components": [[7, "components"]], "Base Data Collector (BDC)": [[7, "base-data-collector-bdc"]], "General description": [[7, "general-description"]], "Design": [[7, "design"], [7, "id1"]], "Data storage": [[7, "data-storage"]], "Merchant Size Predictor (MSP) / Estimated Value Predictor (EVP)": [[7, "merchant-size-predictor-msp-estimated-value-predictor-evp"]], "Historical Note": [[7, "historical-note"]], "Data Fields": [[7, "data-fields"]], "Data Field Definitions": [[7, "data-field-definitions"]], "Data Field Table": [[7, "data-field-table"]], "Links to Data Sources:": [[7, "links-to-data-sources"]], "Data Fields CSV": [[7, "data-fields-csv"]], "Data Field Definition": [[7, "id2"]], "Google Search Strategy": [[7, "google-search-strategy"], [7, "google-search-strategy"]], "Available Lead Information": [[7, "available-lead-information"]], "Available Search Methods": [[7, "available-search-methods"]], "Search Strategy": [[7, "search-strategy"]], "OpenLLM Business Type Analysis": [[7, "openllm-business-type-analysis"]], "Business Type Analysis: Research and Proposed Solution": [[7, "business-type-analysis-research-and-proposed-solution"]], "Research": [[7, "research"]], "Proposed Solution": [[7, "proposed-solution"]], "Conclusion": [[7, "conclusion"], [7, "conclusion"]], "Classifier Comparison": [[7, "classifier-comparison"], [7, "classifier-comparison"]], "Abstract": [[7, "abstract"]], "Experimental Attempts": [[7, "experimental-attempts"]], "Models not performing well": [[7, "models-not-performing-well"]], "Support Vector Machine Classifier Model": [[7, "support-vector-machine-classifier-model"]], "Fully Connected Neural Networks Classifier Model": [[7, "fully-connected-neural-networks-classifier-model"]], "Fully Connected Neural Networks Regression Model": [[7, "fully-connected-neural-networks-regression-model"]], "QDA & Ridge Classifier": [[7, "qda-ridge-classifier"]], "TabNet Architecture": [[7, "tabnet-architecture"]], "Well performing models": [[7, "well-performing-models"]], "Feature subsets": [[7, "feature-subsets"]], "Overall Results": [[7, "overall-results"]], "Results for each class": [[7, "results-for-each-class"]], "5-class split": [[7, "class-split"]], "3-class split": [[7, "id1"]], "Concepts, Unrealized Ideas & Miscellaneous": [[7, "concepts-unrealized-ideas-miscellaneous"]], "Unused Ideas": [[7, "unused-ideas"]], "Deprecated": [[7, "deprecated"]], "Controller": [[7, "controller"], [7, "controller"]], "FacebookGraphAPI": [[7, "facebookgraphapi"]], "ScrapeAddresses": [[7, "scrapeaddresses"]], "Possible ML improvements": [[7, "possible-ml-improvements"]], "Creating data subsets": [[7, "creating-data-subsets"]], "Automation": [[7, "automation"]], "Diagrams": [[7, "diagrams"]], "Sequence Diagram": [[7, "sequence-diagram"]], "Controller Workflow Diagram": [[7, "controller-workflow-diagram"]], "Twitter API Limitation": [[7, "twitter-api-limitation"]], "Limitations of Twitter API for user information retrieval and biased sentiment analysis": [[7, "limitations-of-twitter-api-for-user-information-retrieval-and-biased-sentiment-analysis"]], "Limitation 1: Absence of usernames in provided customer data:": [[7, "limitation-1-absence-of-usernames-in-provided-customer-data"]], "Limitation 2: Inherent Biases in Tweet Content for Sentiment Analysis:": [[7, "limitation-2-inherent-biases-in-tweet-content-for-sentiment-analysis"]], "Links to Twitter\u2019s API documentation:": [[7, "links-to-twitter-s-api-documentation"]], "Contribution": [[7, "contribution"]], "Contribution Workflow": [[7, "contribution-workflow"]], "Branching Strategy": [[7, "branching-strategy"]], "Commits and Pull Requests": [[7, "commits-and-pull-requests"]], "Pull Request Workflow": [[7, "pull-request-workflow"]], "SBOM Generator": [[7, "sbom-generator"]], "Automatic SBOM generation": [[7, "automatic-sbom-generation"]], "Miscellaneous": [[7, "miscellaneous"]], "Miscellaneous Content": [[7, "miscellaneous-content"]], "Knowledge Base": [[7, "knowledge-base"]], "AWS": [[7, "aws"]], "PR Management:": [[7, "pr-management"]], "Branch-Management:": [[7, "branch-management"]], "Pre-commit:": [[7, "pre-commit"]], "Features": [[7, "features"]], "Storage": [[7, "storage"]], "Control flow (Berkay)": [[7, "control-flow-berkay"]], "AI": [[7, "ai"]], "AI Models": [[7, "ai-models"]], "What data do we need?": [[7, "what-data-do-we-need"]], "ML Pipeline": [[7, "ml-pipeline"]], "Troubleshooting": [[7, "troubleshooting"]], "Build": [[7, "build"]], "pipenv": [[7, "pipenv"]], "install stuck": [[7, "install-stuck"]], "Docker": [[7, "docker"]], "VSCode": [[7, "vscode"]], "Testing": [[7, "testing"]], "Reuse": [[7, "reuse"]], "Failed checks": [[7, "failed-checks"]], "BDC": [[7, "bdc"]], "Google Places API": [[7, "google-places-api"]], "Branch-Management": [[7, "id1"]], "Divergent branch": [[7, "divergent-branch"]], "evp package": [[8, "evp-package"]], "evp.evp module": [[8, "module-evp.evp"]], "evp.predictors module": [[8, "module-evp.predictors"]], "Welcome to Sales Lead Qualifier\u2019s documentation!": [[9, "welcome-to-sales-lead-qualifier-s-documentation"]], "Contents:": [[9, null]], "Indices and tables": [[9, "indices-and-tables"]], "logger package": [[10, "logger-package"]], "logger.logger module": [[10, "module-logger.logger"]], "main module": [[11, "module-main"]], "src": [[12, "src"]], "preprocessing package": [[13, "preprocessing-package"]], "preprocessing.preprocessing module": [[13, "module-preprocessing.preprocessing"]], "Sales-Lead-Qualifier Project (AMOS WS 2023/24)": [[14, "sales-lead-qualifier-project-amos-ws-2023-24"]], "Sum Insights Logo": [[14, "sum-insights-logo"]], "Database Connection": [[14, "database-connection"]], "License": [[14, "license"]], "Pre-Commit Hooks": [[14, "pre-commit-hooks"]]}, "indexentries": {"pipeline (class in bdc.pipeline)": [[0, "bdc.pipeline.Pipeline"]], "bdc": [[0, "module-bdc"]], "bdc.pipeline": [[0, "module-bdc.pipeline"]], "module": [[0, "module-bdc"], [0, "module-bdc.pipeline"], [1, "module-bdc.steps"], [1, "module-bdc.steps.analyze_emails"], [1, "module-bdc.steps.analyze_reviews"], [1, "module-bdc.steps.google_places"], [1, "module-bdc.steps.google_places_detailed"], [1, "module-bdc.steps.gpt_summarizer"], [1, "module-bdc.steps.hash_generator"], [1, "module-bdc.steps.preprocess_phonenumbers"], [1, "module-bdc.steps.regionalatlas"], [1, "module-bdc.steps.search_offeneregister"], [1, "module-bdc.steps.step"], [2, "module-bdc.steps.helpers"], [2, "module-bdc.steps.helpers.generate_hash_leads"], [2, "module-bdc.steps.helpers.offeneregister_api"], [2, "module-bdc.steps.helpers.text_analyzer"], [3, "module-config"], [4, "module-database"], [5, "module-database.leads"], [5, "module-database.leads.local_repository"], [5, "module-database.leads.repository"], [5, "module-database.leads.s3_repository"], [6, "module-demo"], [6, "module-demo.console_utils"], [6, "module-demo.demos"], [6, "module-demo.pipeline_utils"], [8, "module-evp"], [8, "module-evp.evp"], [8, "module-evp.predictors"], [10, "module-logger"], [10, "module-logger.logger"], [11, "module-main"], [13, "module-preprocessing"], [13, "module-preprocessing.preprocessing"]], "run() (bdc.pipeline.pipeline method)": [[0, "bdc.pipeline.Pipeline.run"]], "analyzeemails (class in bdc.steps.analyze_emails)": [[1, "bdc.steps.analyze_emails.AnalyzeEmails"]], "gptreviewsentimentanalyzer (class in bdc.steps.analyze_reviews)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer"]], "gptsummarizer (class in bdc.steps.gpt_summarizer)": [[1, "bdc.steps.gpt_summarizer.GPTSummarizer"]], "googleplaces (class in bdc.steps.google_places)": [[1, "bdc.steps.google_places.GooglePlaces"]], "googleplacesdetailed (class in bdc.steps.google_places_detailed)": [[1, "bdc.steps.google_places_detailed.GooglePlacesDetailed"]], "hashgenerator (class in bdc.steps.hash_generator)": [[1, "bdc.steps.hash_generator.HashGenerator"]], "max_prompt_tokens (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer attribute)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.MAX_PROMPT_TOKENS"], [1, "id3"]], "min_ratings_count (bdc.steps.analyze_reviews.smartreviewinsightsenhancer attribute)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer.MIN_RATINGS_COUNT"], [1, "id23"]], "preprocessphonenumbers (class in bdc.steps.preprocess_phonenumbers)": [[1, "bdc.steps.preprocess_phonenumbers.PreprocessPhonenumbers"]], "rating_dominance_threshold (bdc.steps.analyze_reviews.smartreviewinsightsenhancer attribute)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer.RATING_DOMINANCE_THRESHOLD"], [1, "id24"]], "regionalatlas (class in bdc.steps.regionalatlas)": [[1, "bdc.steps.regionalatlas.RegionalAtlas"]], "searchoffeneregister (class in bdc.steps.search_offeneregister)": [[1, "bdc.steps.search_offeneregister.SearchOffeneRegister"]], "smartreviewinsightsenhancer (class in bdc.steps.analyze_reviews)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer"]], "step (class in bdc.steps.step)": [[1, "bdc.steps.step.Step"]], "steperror": [[1, "bdc.steps.step.StepError"]], "_analyze_rating_trend() (bdc.steps.analyze_reviews.smartreviewinsightsenhancer method)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer._analyze_rating_trend"]], "_calculate_average_grammatical_score() (bdc.steps.analyze_reviews.smartreviewinsightsenhancer method)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer._calculate_average_grammatical_score"]], "_calculate_score() (bdc.steps.analyze_reviews.smartreviewinsightsenhancer method)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer._calculate_score"]], "_determine_polarization_type() (bdc.steps.analyze_reviews.smartreviewinsightsenhancer method)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer._determine_polarization_type"]], "_enhance_review_insights() (bdc.steps.analyze_reviews.smartreviewinsightsenhancer method)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer._enhance_review_insights"]], "_extract_company_related_data() (bdc.steps.search_offeneregister.searchoffeneregister method)": [[1, "bdc.steps.search_offeneregister.SearchOffeneRegister._extract_company_related_data"]], "_get_language_tool() (bdc.steps.analyze_reviews.smartreviewinsightsenhancer method)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer._get_language_tool"]], "_grammatical_errors() (bdc.steps.analyze_reviews.smartreviewinsightsenhancer method)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer._grammatical_errors"]], "_quantify_polarization() (bdc.steps.analyze_reviews.smartreviewinsightsenhancer method)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer._quantify_polarization"]], "added_cols (bdc.steps.analyze_emails.analyzeemails attribute)": [[1, "bdc.steps.analyze_emails.AnalyzeEmails.added_cols"], [1, "id0"]], "added_cols (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer attribute)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.added_cols"], [1, "id4"]], "added_cols (bdc.steps.analyze_reviews.smartreviewinsightsenhancer attribute)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer.added_cols"], [1, "id25"]], "added_cols (bdc.steps.google_places.googleplaces attribute)": [[1, "bdc.steps.google_places.GooglePlaces.added_cols"], [1, "id32"]], "added_cols (bdc.steps.google_places_detailed.googleplacesdetailed attribute)": [[1, "bdc.steps.google_places_detailed.GooglePlacesDetailed.added_cols"], [1, "id35"]], "added_cols (bdc.steps.gpt_summarizer.gptsummarizer attribute)": [[1, "bdc.steps.gpt_summarizer.GPTSummarizer.added_cols"], [1, "id38"]], "added_cols (bdc.steps.hash_generator.hashgenerator attribute)": [[1, "bdc.steps.hash_generator.HashGenerator.added_cols"], [1, "id41"]], "added_cols (bdc.steps.preprocess_phonenumbers.preprocessphonenumbers attribute)": [[1, "bdc.steps.preprocess_phonenumbers.PreprocessPhonenumbers.added_cols"], [1, "id44"]], "added_cols (bdc.steps.regionalatlas.regionalatlas attribute)": [[1, "bdc.steps.regionalatlas.RegionalAtlas.added_cols"], [1, "id47"]], "added_cols (bdc.steps.search_offeneregister.searchoffeneregister attribute)": [[1, "bdc.steps.search_offeneregister.SearchOffeneRegister.added_cols"], [1, "id55"]], "added_cols (bdc.steps.step.step attribute)": [[1, "bdc.steps.step.Step.added_cols"], [1, "id63"]], "analyze_email_account() (in module bdc.steps.analyze_emails)": [[1, "bdc.steps.analyze_emails.analyze_email_account"]], "api_fields (bdc.steps.google_places.googleplaces attribute)": [[1, "bdc.steps.google_places.GooglePlaces.api_fields"]], "api_fields (bdc.steps.google_places_detailed.googleplacesdetailed attribute)": [[1, "bdc.steps.google_places_detailed.GooglePlacesDetailed.api_fields"]], "api_fields_output (bdc.steps.google_places_detailed.googleplacesdetailed attribute)": [[1, "bdc.steps.google_places_detailed.GooglePlacesDetailed.api_fields_output"]], "batch_reviews() (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer method)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.batch_reviews"], [1, "id5"]], "bdc.steps": [[1, "module-bdc.steps"]], "bdc.steps.analyze_emails": [[1, "module-bdc.steps.analyze_emails"]], "bdc.steps.analyze_reviews": [[1, "module-bdc.steps.analyze_reviews"]], "bdc.steps.google_places": [[1, "module-bdc.steps.google_places"]], "bdc.steps.google_places_detailed": [[1, "module-bdc.steps.google_places_detailed"]], "bdc.steps.gpt_summarizer": [[1, "module-bdc.steps.gpt_summarizer"]], "bdc.steps.hash_generator": [[1, "module-bdc.steps.hash_generator"]], "bdc.steps.preprocess_phonenumbers": [[1, "module-bdc.steps.preprocess_phonenumbers"]], "bdc.steps.regionalatlas": [[1, "module-bdc.steps.regionalatlas"]], "bdc.steps.search_offeneregister": [[1, "module-bdc.steps.search_offeneregister"]], "bdc.steps.step": [[1, "module-bdc.steps.step"]], "calculate_confidence() (bdc.steps.google_places.googleplaces method)": [[1, "bdc.steps.google_places.GooglePlaces.calculate_confidence"]], "calculate_regional_score() (bdc.steps.regionalatlas.regionalatlas method)": [[1, "bdc.steps.regionalatlas.RegionalAtlas.calculate_regional_score"]], "check_api_key() (in module bdc.steps.analyze_reviews)": [[1, "bdc.steps.analyze_reviews.check_api_key"]], "check_data_presence() (bdc.steps.step.step method)": [[1, "bdc.steps.step.Step.check_data_presence"]], "check_number() (bdc.steps.preprocess_phonenumbers.preprocessphonenumbers method)": [[1, "bdc.steps.preprocess_phonenumbers.PreprocessPhonenumbers.check_number"]], "client (bdc.steps.gpt_summarizer.gptsummarizer attribute)": [[1, "bdc.steps.gpt_summarizer.GPTSummarizer.client"]], "df (bdc.steps.step.step property)": [[1, "bdc.steps.step.Step.df"]], "df_fields (bdc.steps.google_places.googleplaces attribute)": [[1, "bdc.steps.google_places.GooglePlaces.df_fields"]], "df_fields (bdc.steps.google_places_detailed.googleplacesdetailed attribute)": [[1, "bdc.steps.google_places_detailed.GooglePlacesDetailed.df_fields"]], "df_fields (bdc.steps.regionalatlas.regionalatlas attribute)": [[1, "bdc.steps.regionalatlas.RegionalAtlas.df_fields"], [1, "id48"]], "empty_result (bdc.steps.regionalatlas.regionalatlas attribute)": [[1, "bdc.steps.regionalatlas.RegionalAtlas.empty_result"], [1, "id49"]], "epsg_code_etrs (bdc.steps.regionalatlas.regionalatlas attribute)": [[1, "bdc.steps.regionalatlas.RegionalAtlas.epsg_code_etrs"], [1, "id50"]], "extract_custom_domain() (in module bdc.steps.analyze_emails)": [[1, "bdc.steps.analyze_emails.extract_custom_domain"]], "extract_text_from_reviews() (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer method)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.extract_text_from_reviews"], [1, "id6"]], "extract_the_raw_html_and_parse() (bdc.steps.gpt_summarizer.gptsummarizer method)": [[1, "bdc.steps.gpt_summarizer.GPTSummarizer.extract_the_raw_html_and_parse"]], "extracted_col_name (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer attribute)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.extracted_col_name"], [1, "id7"]], "extracted_col_name_website_summary (bdc.steps.gpt_summarizer.gptsummarizer attribute)": [[1, "bdc.steps.gpt_summarizer.GPTSummarizer.extracted_col_name_website_summary"]], "finish() (bdc.steps.analyze_emails.analyzeemails method)": [[1, "bdc.steps.analyze_emails.AnalyzeEmails.finish"]], "finish() (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer method)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.finish"], [1, "id8"]], "finish() (bdc.steps.analyze_reviews.smartreviewinsightsenhancer method)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer.finish"], [1, "id26"]], "finish() (bdc.steps.google_places.googleplaces method)": [[1, "bdc.steps.google_places.GooglePlaces.finish"]], "finish() (bdc.steps.google_places_detailed.googleplacesdetailed method)": [[1, "bdc.steps.google_places_detailed.GooglePlacesDetailed.finish"]], "finish() (bdc.steps.gpt_summarizer.gptsummarizer method)": [[1, "bdc.steps.gpt_summarizer.GPTSummarizer.finish"]], "finish() (bdc.steps.hash_generator.hashgenerator method)": [[1, "bdc.steps.hash_generator.HashGenerator.finish"]], "finish() (bdc.steps.preprocess_phonenumbers.preprocessphonenumbers method)": [[1, "bdc.steps.preprocess_phonenumbers.PreprocessPhonenumbers.finish"]], "finish() (bdc.steps.regionalatlas.regionalatlas method)": [[1, "bdc.steps.regionalatlas.RegionalAtlas.finish"]], "finish() (bdc.steps.search_offeneregister.searchoffeneregister method)": [[1, "bdc.steps.search_offeneregister.SearchOffeneRegister.finish"], [1, "id56"]], "finish() (bdc.steps.step.step method)": [[1, "bdc.steps.step.Step.finish"]], "get_data_from_address() (bdc.steps.regionalatlas.regionalatlas method)": [[1, "bdc.steps.regionalatlas.RegionalAtlas.get_data_from_address"]], "get_data_from_detailed_google_api() (bdc.steps.google_places_detailed.googleplacesdetailed method)": [[1, "bdc.steps.google_places_detailed.GooglePlacesDetailed.get_data_from_detailed_google_api"]], "get_data_from_google_api() (bdc.steps.google_places.googleplaces method)": [[1, "bdc.steps.google_places.GooglePlaces.get_data_from_google_api"]], "get_first_place_candidate() (bdc.steps.google_places.googleplaces method)": [[1, "bdc.steps.google_places.GooglePlaces.get_first_place_candidate"]], "gmaps (bdc.steps.google_places.googleplaces attribute)": [[1, "bdc.steps.google_places.GooglePlaces.gmaps"]], "gmaps (bdc.steps.google_places_detailed.googleplacesdetailed attribute)": [[1, "bdc.steps.google_places_detailed.GooglePlacesDetailed.gmaps"]], "gpt (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer attribute)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.gpt"], [1, "id9"]], "gpt_calculate_avg_sentiment_score() (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer method)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.gpt_calculate_avg_sentiment_score"]], "gpt_required_fields (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer attribute)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.gpt_required_fields"], [1, "id10"]], "gpt_required_fields (bdc.steps.gpt_summarizer.gptsummarizer attribute)": [[1, "bdc.steps.gpt_summarizer.GPTSummarizer.gpt_required_fields"]], "gpt_sentiment_analyze_review() (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer method)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.gpt_sentiment_analyze_review"], [1, "id11"]], "is_review_valid() (in module bdc.steps.analyze_reviews)": [[1, "bdc.steps.analyze_reviews.is_review_valid"]], "language_tools (bdc.steps.analyze_reviews.smartreviewinsightsenhancer attribute)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer.language_tools"]], "load_data() (bdc.steps.analyze_emails.analyzeemails method)": [[1, "bdc.steps.analyze_emails.AnalyzeEmails.load_data"]], "load_data() (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer method)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.load_data"], [1, "id12"]], "load_data() (bdc.steps.analyze_reviews.smartreviewinsightsenhancer method)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer.load_data"], [1, "id27"]], "load_data() (bdc.steps.google_places.googleplaces method)": [[1, "bdc.steps.google_places.GooglePlaces.load_data"]], "load_data() (bdc.steps.google_places_detailed.googleplacesdetailed method)": [[1, "bdc.steps.google_places_detailed.GooglePlacesDetailed.load_data"]], "load_data() (bdc.steps.gpt_summarizer.gptsummarizer method)": [[1, "bdc.steps.gpt_summarizer.GPTSummarizer.load_data"]], "load_data() (bdc.steps.hash_generator.hashgenerator method)": [[1, "bdc.steps.hash_generator.HashGenerator.load_data"]], "load_data() (bdc.steps.preprocess_phonenumbers.preprocessphonenumbers method)": [[1, "bdc.steps.preprocess_phonenumbers.PreprocessPhonenumbers.load_data"]], "load_data() (bdc.steps.regionalatlas.regionalatlas method)": [[1, "bdc.steps.regionalatlas.RegionalAtlas.load_data"]], "load_data() (bdc.steps.search_offeneregister.searchoffeneregister method)": [[1, "bdc.steps.search_offeneregister.SearchOffeneRegister.load_data"], [1, "id57"]], "load_data() (bdc.steps.step.step method)": [[1, "bdc.steps.step.Step.load_data"]], "log (in module bdc.steps.analyze_reviews)": [[1, "bdc.steps.analyze_reviews.log"]], "model (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer attribute)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.model"], [1, "id13"]], "model (bdc.steps.gpt_summarizer.gptsummarizer attribute)": [[1, "bdc.steps.gpt_summarizer.GPTSummarizer.model"]], "model_encoding_name (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer attribute)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.model_encoding_name"], [1, "id14"]], "name (bdc.steps.analyze_emails.analyzeemails attribute)": [[1, "bdc.steps.analyze_emails.AnalyzeEmails.name"], [1, "id1"]], "name (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer attribute)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.name"], [1, "id15"]], "name (bdc.steps.analyze_reviews.smartreviewinsightsenhancer attribute)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer.name"], [1, "id28"]], "name (bdc.steps.google_places.googleplaces attribute)": [[1, "bdc.steps.google_places.GooglePlaces.name"], [1, "id33"]], "name (bdc.steps.google_places_detailed.googleplacesdetailed attribute)": [[1, "bdc.steps.google_places_detailed.GooglePlacesDetailed.name"], [1, "id36"]], "name (bdc.steps.gpt_summarizer.gptsummarizer attribute)": [[1, "bdc.steps.gpt_summarizer.GPTSummarizer.name"], [1, "id39"]], "name (bdc.steps.hash_generator.hashgenerator attribute)": [[1, "bdc.steps.hash_generator.HashGenerator.name"], [1, "id42"]], "name (bdc.steps.preprocess_phonenumbers.preprocessphonenumbers attribute)": [[1, "bdc.steps.preprocess_phonenumbers.PreprocessPhonenumbers.name"], [1, "id45"]], "name (bdc.steps.regionalatlas.regionalatlas attribute)": [[1, "bdc.steps.regionalatlas.RegionalAtlas.name"], [1, "id51"]], "name (bdc.steps.search_offeneregister.searchoffeneregister attribute)": [[1, "bdc.steps.search_offeneregister.SearchOffeneRegister.name"], [1, "id58"]], "name (bdc.steps.step.step attribute)": [[1, "bdc.steps.step.Step.name"], [1, "id64"]], "no_answer (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer attribute)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.no_answer"], [1, "id16"]], "no_answer (bdc.steps.gpt_summarizer.gptsummarizer attribute)": [[1, "bdc.steps.gpt_summarizer.GPTSummarizer.no_answer"]], "num_tokens_from_string() (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer method)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.num_tokens_from_string"], [1, "id17"]], "offeneregisterapi (bdc.steps.search_offeneregister.searchoffeneregister attribute)": [[1, "bdc.steps.search_offeneregister.SearchOffeneRegister.offeneregisterAPI"], [1, "id59"]], "process_row() (bdc.steps.preprocess_phonenumbers.preprocessphonenumbers method)": [[1, "bdc.steps.preprocess_phonenumbers.PreprocessPhonenumbers.process_row"]], "reagionalatlas_feature_keys (bdc.steps.regionalatlas.regionalatlas attribute)": [[1, "bdc.steps.regionalatlas.RegionalAtlas.reagionalatlas_feature_keys"], [1, "id52"]], "regions_gdfs (bdc.steps.regionalatlas.regionalatlas attribute)": [[1, "bdc.steps.regionalatlas.RegionalAtlas.regions_gdfs"], [1, "id53"]], "required_cols (bdc.steps.analyze_emails.analyzeemails attribute)": [[1, "bdc.steps.analyze_emails.AnalyzeEmails.required_cols"], [1, "id2"]], "required_cols (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer attribute)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.required_cols"]], "required_cols (bdc.steps.google_places.googleplaces attribute)": [[1, "bdc.steps.google_places.GooglePlaces.required_cols"], [1, "id34"]], "required_cols (bdc.steps.google_places_detailed.googleplacesdetailed attribute)": [[1, "bdc.steps.google_places_detailed.GooglePlacesDetailed.required_cols"], [1, "id37"]], "required_cols (bdc.steps.gpt_summarizer.gptsummarizer attribute)": [[1, "bdc.steps.gpt_summarizer.GPTSummarizer.required_cols"], [1, "id40"]], "required_cols (bdc.steps.hash_generator.hashgenerator attribute)": [[1, "bdc.steps.hash_generator.HashGenerator.required_cols"], [1, "id43"]], "required_cols (bdc.steps.preprocess_phonenumbers.preprocessphonenumbers attribute)": [[1, "bdc.steps.preprocess_phonenumbers.PreprocessPhonenumbers.required_cols"], [1, "id46"]], "required_cols (bdc.steps.regionalatlas.regionalatlas attribute)": [[1, "bdc.steps.regionalatlas.RegionalAtlas.required_cols"], [1, "id54"]], "required_cols (bdc.steps.search_offeneregister.searchoffeneregister attribute)": [[1, "bdc.steps.search_offeneregister.SearchOffeneRegister.required_cols"], [1, "id60"]], "required_cols (bdc.steps.step.step attribute)": [[1, "bdc.steps.step.Step.required_cols"], [1, "id65"]], "required_fields (bdc.steps.analyze_reviews.smartreviewinsightsenhancer attribute)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer.required_fields"], [1, "id29"]], "run() (bdc.steps.analyze_emails.analyzeemails method)": [[1, "bdc.steps.analyze_emails.AnalyzeEmails.run"]], "run() (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer method)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.run"], [1, "id18"]], "run() (bdc.steps.analyze_reviews.smartreviewinsightsenhancer method)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer.run"], [1, "id30"]], "run() (bdc.steps.google_places.googleplaces method)": [[1, "bdc.steps.google_places.GooglePlaces.run"]], "run() (bdc.steps.google_places_detailed.googleplacesdetailed method)": [[1, "bdc.steps.google_places_detailed.GooglePlacesDetailed.run"]], "run() (bdc.steps.gpt_summarizer.gptsummarizer method)": [[1, "bdc.steps.gpt_summarizer.GPTSummarizer.run"]], "run() (bdc.steps.hash_generator.hashgenerator method)": [[1, "bdc.steps.hash_generator.HashGenerator.run"]], "run() (bdc.steps.preprocess_phonenumbers.preprocessphonenumbers method)": [[1, "bdc.steps.preprocess_phonenumbers.PreprocessPhonenumbers.run"]], "run() (bdc.steps.regionalatlas.regionalatlas method)": [[1, "bdc.steps.regionalatlas.RegionalAtlas.run"]], "run() (bdc.steps.search_offeneregister.searchoffeneregister method)": [[1, "bdc.steps.search_offeneregister.SearchOffeneRegister.run"], [1, "id61"]], "run() (bdc.steps.step.step method)": [[1, "bdc.steps.step.Step.run"]], "run_sentiment_analysis() (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer method)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.run_sentiment_analysis"], [1, "id19"]], "summarize_the_company_website() (bdc.steps.gpt_summarizer.gptsummarizer method)": [[1, "bdc.steps.gpt_summarizer.GPTSummarizer.summarize_the_company_website"]], "system_message_for_sentiment_analysis (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer attribute)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.system_message_for_sentiment_analysis"], [1, "id20"]], "system_message_for_website_summary (bdc.steps.gpt_summarizer.gptsummarizer attribute)": [[1, "bdc.steps.gpt_summarizer.GPTSummarizer.system_message_for_website_summary"]], "text_analyzer (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer attribute)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.text_analyzer"]], "text_analyzer (bdc.steps.analyze_reviews.smartreviewinsightsenhancer attribute)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer.text_analyzer"]], "textblob_calculate_avg_sentiment_score() (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer method)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.textblob_calculate_avg_sentiment_score"]], "user_message_for_sentiment_analysis (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer attribute)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.user_message_for_sentiment_analysis"], [1, "id21"]], "user_message_for_website_summary (bdc.steps.gpt_summarizer.gptsummarizer attribute)": [[1, "bdc.steps.gpt_summarizer.GPTSummarizer.user_message_for_website_summary"]], "verify() (bdc.steps.analyze_emails.analyzeemails method)": [[1, "bdc.steps.analyze_emails.AnalyzeEmails.verify"]], "verify() (bdc.steps.analyze_reviews.gptreviewsentimentanalyzer method)": [[1, "bdc.steps.analyze_reviews.GPTReviewSentimentAnalyzer.verify"], [1, "id22"]], "verify() (bdc.steps.analyze_reviews.smartreviewinsightsenhancer method)": [[1, "bdc.steps.analyze_reviews.SmartReviewInsightsEnhancer.verify"], [1, "id31"]], "verify() (bdc.steps.google_places.googleplaces method)": [[1, "bdc.steps.google_places.GooglePlaces.verify"]], "verify() (bdc.steps.google_places_detailed.googleplacesdetailed method)": [[1, "bdc.steps.google_places_detailed.GooglePlacesDetailed.verify"]], "verify() (bdc.steps.gpt_summarizer.gptsummarizer method)": [[1, "bdc.steps.gpt_summarizer.GPTSummarizer.verify"]], "verify() (bdc.steps.hash_generator.hashgenerator method)": [[1, "bdc.steps.hash_generator.HashGenerator.verify"]], "verify() (bdc.steps.preprocess_phonenumbers.preprocessphonenumbers method)": [[1, "bdc.steps.preprocess_phonenumbers.PreprocessPhonenumbers.verify"]], "verify() (bdc.steps.regionalatlas.regionalatlas method)": [[1, "bdc.steps.regionalatlas.RegionalAtlas.verify"]], "verify() (bdc.steps.search_offeneregister.searchoffeneregister method)": [[1, "bdc.steps.search_offeneregister.SearchOffeneRegister.verify"], [1, "id62"]], "verify() (bdc.steps.step.step method)": [[1, "bdc.steps.step.Step.verify"]], "base_path (bdc.steps.helpers.generate_hash_leads.leadhashgenerator attribute)": [[2, "bdc.steps.helpers.generate_hash_leads.LeadHashGenerator.BASE_PATH"]], "leadhashgenerator (class in bdc.steps.helpers.generate_hash_leads)": [[2, "bdc.steps.helpers.generate_hash_leads.LeadHashGenerator"]], "offeneregisterapi (class in bdc.steps.helpers.offeneregister_api)": [[2, "bdc.steps.helpers.offeneregister_api.OffeneRegisterAPI"]], "target_lang (bdc.steps.helpers.text_analyzer.textanalyzer attribute)": [[2, "bdc.steps.helpers.text_analyzer.TextAnalyzer.TARGET_LANG"]], "textanalyzer (class in bdc.steps.helpers.text_analyzer)": [[2, "bdc.steps.helpers.text_analyzer.TextAnalyzer"]], "bdc.steps.helpers": [[2, "module-bdc.steps.helpers"]], "bdc.steps.helpers.generate_hash_leads": [[2, "module-bdc.steps.helpers.generate_hash_leads"]], "bdc.steps.helpers.offeneregister_api": [[2, "module-bdc.steps.helpers.offeneregister_api"]], "bdc.steps.helpers.text_analyzer": [[2, "module-bdc.steps.helpers.text_analyzer"]], "calculate_sentiment_analysis_score() (bdc.steps.helpers.text_analyzer.textanalyzer method)": [[2, "bdc.steps.helpers.text_analyzer.TextAnalyzer.calculate_sentiment_analysis_score"]], "correct_text() (bdc.steps.helpers.text_analyzer.textanalyzer method)": [[2, "bdc.steps.helpers.text_analyzer.TextAnalyzer.correct_text"]], "find_companyaddress_by_lastname_firstname() (bdc.steps.helpers.offeneregister_api.offeneregisterapi method)": [[2, "bdc.steps.helpers.offeneregister_api.OffeneRegisterAPI.find_companyAddress_by_lastName_firstName"]], "find_companycapitals_by_lastname_firstname() (bdc.steps.helpers.offeneregister_api.offeneregisterapi method)": [[2, "bdc.steps.helpers.offeneregister_api.OffeneRegisterAPI.find_companyCapitals_by_lastName_firstName"]], "find_companyname_by_lastname_firstname() (bdc.steps.helpers.offeneregister_api.offeneregisterapi method)": [[2, "bdc.steps.helpers.offeneregister_api.OffeneRegisterAPI.find_companyName_by_lastName_firstName"]], "find_companyobjective_by_lastname_firstname() (bdc.steps.helpers.offeneregister_api.offeneregisterapi method)": [[2, "bdc.steps.helpers.offeneregister_api.OffeneRegisterAPI.find_companyObjective_by_lastName_firstName"]], "find_number_of_grammatical_errors() (bdc.steps.helpers.text_analyzer.textanalyzer method)": [[2, "bdc.steps.helpers.text_analyzer.TextAnalyzer.find_number_of_grammatical_errors"]], "find_number_of_spelling_errors() (bdc.steps.helpers.text_analyzer.textanalyzer method)": [[2, "bdc.steps.helpers.text_analyzer.TextAnalyzer.find_number_of_spelling_errors"]], "find_spelling_errors() (bdc.steps.helpers.text_analyzer.textanalyzer method)": [[2, "bdc.steps.helpers.text_analyzer.TextAnalyzer.find_spelling_errors"]], "get_lead_hash_generator() (in module bdc.steps.helpers)": [[2, "bdc.steps.helpers.get_lead_hash_generator"]], "hash_check() (bdc.steps.helpers.generate_hash_leads.leadhashgenerator method)": [[2, "bdc.steps.helpers.generate_hash_leads.LeadHashGenerator.hash_check"]], "hash_lead() (bdc.steps.helpers.generate_hash_leads.leadhashgenerator method)": [[2, "bdc.steps.helpers.generate_hash_leads.LeadHashGenerator.hash_lead"]], "translate() (bdc.steps.helpers.text_analyzer.textanalyzer method)": [[2, "bdc.steps.helpers.text_analyzer.TextAnalyzer.translate"]], "config": [[3, "module-config"]], "database": [[4, "module-database"]], "get_database() (in module database)": [[4, "database.get_database"]], "base_path (database.leads.local_repository.localrepository attribute)": [[5, "database.leads.local_repository.LocalRepository.BASE_PATH"]], "classification_reports (database.leads.local_repository.localrepository attribute)": [[5, "database.leads.local_repository.LocalRepository.CLASSIFICATION_REPORTS"]], "classification_reports (database.leads.s3_repository.s3repository attribute)": [[5, "database.leads.s3_repository.S3Repository.CLASSIFICATION_REPORTS"]], "datetime_format (database.leads.repository.repository attribute)": [[5, "database.leads.repository.Repository.DATETIME_FORMAT"]], "df_historical_output (database.leads.local_repository.localrepository attribute)": [[5, "database.leads.local_repository.LocalRepository.DF_HISTORICAL_OUTPUT"]], "df_historical_output (database.leads.repository.repository property)": [[5, "database.leads.repository.Repository.DF_HISTORICAL_OUTPUT"]], "df_historical_output (database.leads.s3_repository.s3repository attribute)": [[5, "database.leads.s3_repository.S3Repository.DF_HISTORICAL_OUTPUT"]], "df_input (database.leads.local_repository.localrepository attribute)": [[5, "database.leads.local_repository.LocalRepository.DF_INPUT"]], "df_input (database.leads.repository.repository property)": [[5, "database.leads.repository.Repository.DF_INPUT"]], "df_input (database.leads.s3_repository.s3repository attribute)": [[5, "database.leads.s3_repository.S3Repository.DF_INPUT"]], "df_output (database.leads.local_repository.localrepository attribute)": [[5, "database.leads.local_repository.LocalRepository.DF_OUTPUT"]], "df_output (database.leads.repository.repository property)": [[5, "database.leads.repository.Repository.DF_OUTPUT"]], "df_output (database.leads.s3_repository.s3repository attribute)": [[5, "database.leads.s3_repository.S3Repository.DF_OUTPUT"]], "df_prediction_output (database.leads.local_repository.localrepository attribute)": [[5, "database.leads.local_repository.LocalRepository.DF_PREDICTION_OUTPUT"]], "df_prediction_output (database.leads.s3_repository.s3repository attribute)": [[5, "database.leads.s3_repository.S3Repository.DF_PREDICTION_OUTPUT"]], "df_preprocessed_input (database.leads.local_repository.localrepository attribute)": [[5, "database.leads.local_repository.LocalRepository.DF_PREPROCESSED_INPUT"]], "df_preprocessed_input (database.leads.s3_repository.s3repository attribute)": [[5, "database.leads.s3_repository.S3Repository.DF_PREPROCESSED_INPUT"]], "events_bucket (database.leads.s3_repository.s3repository attribute)": [[5, "database.leads.s3_repository.S3Repository.EVENTS_BUCKET"]], "features_bucket (database.leads.s3_repository.s3repository attribute)": [[5, "database.leads.s3_repository.S3Repository.FEATURES_BUCKET"]], "gpt_results (database.leads.local_repository.localrepository attribute)": [[5, "database.leads.local_repository.LocalRepository.GPT_RESULTS"]], "gpt_results (database.leads.repository.repository property)": [[5, "database.leads.repository.Repository.GPT_RESULTS"]], "gpt_results (database.leads.s3_repository.s3repository attribute)": [[5, "database.leads.s3_repository.S3Repository.GPT_RESULTS"]], "lookup_tables (database.leads.s3_repository.s3repository attribute)": [[5, "database.leads.s3_repository.S3Repository.LOOKUP_TABLES"]], "localrepository (class in database.leads.local_repository)": [[5, "database.leads.local_repository.LocalRepository"]], "ml_models (database.leads.local_repository.localrepository attribute)": [[5, "database.leads.local_repository.LocalRepository.ML_MODELS"]], "ml_models (database.leads.s3_repository.s3repository attribute)": [[5, "database.leads.s3_repository.S3Repository.ML_MODELS"]], "models_bucket (database.leads.s3_repository.s3repository attribute)": [[5, "database.leads.s3_repository.S3Repository.MODELS_BUCKET"]], "reviews (database.leads.local_repository.localrepository attribute)": [[5, "database.leads.local_repository.LocalRepository.REVIEWS"]], "reviews (database.leads.repository.repository property)": [[5, "database.leads.repository.Repository.REVIEWS"]], "reviews (database.leads.s3_repository.s3repository attribute)": [[5, "database.leads.s3_repository.S3Repository.REVIEWS"]], "repository (class in database.leads.repository)": [[5, "database.leads.repository.Repository"]], "s3repository (class in database.leads.s3_repository)": [[5, "database.leads.s3_repository.S3Repository"]], "snapshots (database.leads.local_repository.localrepository attribute)": [[5, "database.leads.local_repository.LocalRepository.SNAPSHOTS"]], "snapshots (database.leads.repository.repository property)": [[5, "database.leads.repository.Repository.SNAPSHOTS"]], "snapshots (database.leads.s3_repository.s3repository attribute)": [[5, "database.leads.s3_repository.S3Repository.SNAPSHOTS"]], "clean_snapshots() (database.leads.local_repository.localrepository method)": [[5, "database.leads.local_repository.LocalRepository.clean_snapshots"]], "clean_snapshots() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.clean_snapshots"]], "clean_snapshots() (database.leads.s3_repository.s3repository method)": [[5, "database.leads.s3_repository.S3Repository.clean_snapshots"]], "create_snapshot() (database.leads.local_repository.localrepository method)": [[5, "database.leads.local_repository.LocalRepository.create_snapshot"]], "create_snapshot() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.create_snapshot"]], "create_snapshot() (database.leads.s3_repository.s3repository method)": [[5, "database.leads.s3_repository.S3Repository.create_snapshot"]], "database.leads": [[5, "module-database.leads"]], "database.leads.local_repository": [[5, "module-database.leads.local_repository"]], "database.leads.repository": [[5, "module-database.leads.repository"]], "database.leads.s3_repository": [[5, "module-database.leads.s3_repository"]], "decode_s3_url() (in module database.leads.s3_repository)": [[5, "database.leads.s3_repository.decode_s3_url"]], "fetch_gpt_result() (database.leads.local_repository.localrepository method)": [[5, "database.leads.local_repository.LocalRepository.fetch_gpt_result"]], "fetch_gpt_result() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.fetch_gpt_result"]], "fetch_gpt_result() (database.leads.s3_repository.s3repository method)": [[5, "database.leads.s3_repository.S3Repository.fetch_gpt_result"]], "fetch_review() (database.leads.local_repository.localrepository method)": [[5, "database.leads.local_repository.LocalRepository.fetch_review"]], "fetch_review() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.fetch_review"]], "fetch_review() (database.leads.s3_repository.s3repository method)": [[5, "database.leads.s3_repository.S3Repository.fetch_review"]], "get_dataframe() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.get_dataframe"]], "get_enriched_data_path() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.get_enriched_data_path"]], "get_input_path() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.get_input_path"]], "get_preprocessed_data_path() (database.leads.local_repository.localrepository method)": [[5, "database.leads.local_repository.LocalRepository.get_preprocessed_data_path"]], "get_preprocessed_data_path() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.get_preprocessed_data_path"]], "get_preprocessed_data_path() (database.leads.s3_repository.s3repository method)": [[5, "database.leads.s3_repository.S3Repository.get_preprocessed_data_path"]], "insert_data() (database.leads.local_repository.localrepository method)": [[5, "database.leads.local_repository.LocalRepository.insert_data"]], "insert_data() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.insert_data"]], "insert_data() (database.leads.s3_repository.s3repository method)": [[5, "database.leads.s3_repository.S3Repository.insert_data"]], "load_classification_report() (database.leads.local_repository.localrepository method)": [[5, "database.leads.local_repository.LocalRepository.load_classification_report"]], "load_classification_report() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.load_classification_report"]], "load_classification_report() (database.leads.s3_repository.s3repository method)": [[5, "database.leads.s3_repository.S3Repository.load_classification_report"]], "load_lookup_table() (database.leads.local_repository.localrepository method)": [[5, "database.leads.local_repository.LocalRepository.load_lookup_table"]], "load_lookup_table() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.load_lookup_table"]], "load_lookup_table() (database.leads.s3_repository.s3repository method)": [[5, "database.leads.s3_repository.S3Repository.load_lookup_table"]], "load_ml_model() (database.leads.local_repository.localrepository method)": [[5, "database.leads.local_repository.LocalRepository.load_ml_model"]], "load_ml_model() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.load_ml_model"]], "load_ml_model() (database.leads.s3_repository.s3repository method)": [[5, "database.leads.s3_repository.S3Repository.load_ml_model"]], "load_preprocessed_data() (database.leads.local_repository.localrepository method)": [[5, "database.leads.local_repository.LocalRepository.load_preprocessed_data"]], "load_preprocessed_data() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.load_preprocessed_data"]], "load_preprocessed_data() (database.leads.s3_repository.s3repository method)": [[5, "database.leads.s3_repository.S3Repository.load_preprocessed_data"]], "save_classification_report() (database.leads.local_repository.localrepository method)": [[5, "database.leads.local_repository.LocalRepository.save_classification_report"]], "save_classification_report() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.save_classification_report"]], "save_classification_report() (database.leads.s3_repository.s3repository method)": [[5, "database.leads.s3_repository.S3Repository.save_classification_report"]], "save_dataframe() (database.leads.local_repository.localrepository method)": [[5, "database.leads.local_repository.LocalRepository.save_dataframe"]], "save_dataframe() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.save_dataframe"]], "save_dataframe() (database.leads.s3_repository.s3repository method)": [[5, "database.leads.s3_repository.S3Repository.save_dataframe"]], "save_gpt_result() (database.leads.local_repository.localrepository method)": [[5, "database.leads.local_repository.LocalRepository.save_gpt_result"]], "save_gpt_result() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.save_gpt_result"]], "save_gpt_result() (database.leads.s3_repository.s3repository method)": [[5, "database.leads.s3_repository.S3Repository.save_gpt_result"]], "save_lookup_table() (database.leads.local_repository.localrepository method)": [[5, "database.leads.local_repository.LocalRepository.save_lookup_table"]], "save_lookup_table() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.save_lookup_table"]], "save_lookup_table() (database.leads.s3_repository.s3repository method)": [[5, "database.leads.s3_repository.S3Repository.save_lookup_table"]], "save_ml_model() (database.leads.local_repository.localrepository method)": [[5, "database.leads.local_repository.LocalRepository.save_ml_model"]], "save_ml_model() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.save_ml_model"]], "save_ml_model() (database.leads.s3_repository.s3repository method)": [[5, "database.leads.s3_repository.S3Repository.save_ml_model"]], "save_prediction() (database.leads.local_repository.localrepository method)": [[5, "database.leads.local_repository.LocalRepository.save_prediction"]], "save_prediction() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.save_prediction"]], "save_prediction() (database.leads.s3_repository.s3repository method)": [[5, "database.leads.s3_repository.S3Repository.save_prediction"]], "save_review() (database.leads.local_repository.localrepository method)": [[5, "database.leads.local_repository.LocalRepository.save_review"]], "save_review() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.save_review"]], "save_review() (database.leads.s3_repository.s3repository method)": [[5, "database.leads.s3_repository.S3Repository.save_review"]], "set_dataframe() (database.leads.repository.repository method)": [[5, "database.leads.repository.Repository.set_dataframe"]], "add_step_if_requested() (in module demo.demos)": [[6, "demo.demos.add_step_if_requested"]], "demo": [[6, "module-demo"]], "demo.console_utils": [[6, "module-demo.console_utils"]], "demo.demos": [[6, "module-demo.demos"]], "demo.pipeline_utils": [[6, "module-demo.pipeline_utils"]], "evp_demo() (in module demo.demos)": [[6, "demo.demos.evp_demo"]], "get_all_available_pipeline_json_configs() (in module demo.pipeline_utils)": [[6, "demo.pipeline_utils.get_all_available_pipeline_json_configs"]], "get_int_input() (in module demo.console_utils)": [[6, "demo.console_utils.get_int_input"]], "get_multiple_choice() (in module demo.console_utils)": [[6, "demo.console_utils.get_multiple_choice"]], "get_pipeline_additional_steps() (in module demo.pipeline_utils)": [[6, "demo.pipeline_utils.get_pipeline_additional_steps"]], "get_pipeline_config_from_json() (in module demo.pipeline_utils)": [[6, "demo.pipeline_utils.get_pipeline_config_from_json"]], "get_pipeline_initial_steps() (in module demo.pipeline_utils)": [[6, "demo.pipeline_utils.get_pipeline_initial_steps"]], "get_pipeline_steps() (in module demo.pipeline_utils)": [[6, "demo.pipeline_utils.get_pipeline_steps"]], "get_string_input() (in module demo.console_utils)": [[6, "demo.console_utils.get_string_input"]], "get_yes_no_input() (in module demo.console_utils)": [[6, "demo.console_utils.get_yes_no_input"]], "pipeline_demo() (in module demo.demos)": [[6, "demo.demos.pipeline_demo"]], "predict_merchantsize_on_lead_data_demo() (in module demo.demos)": [[6, "demo.demos.predict_MerchantSize_on_lead_data_demo"]], "predict_single_lead() (in module demo.demos)": [[6, "demo.demos.predict_single_lead"]], "preprocessing_demo() (in module demo.demos)": [[6, "demo.demos.preprocessing_demo"]], "test_evp_model() (in module demo.demos)": [[6, "demo.demos.test_evp_model"]], "adaboost (class in evp.predictors)": [[8, "evp.predictors.AdaBoost"]], "adaboost (evp.predictors.predictors attribute)": [[8, "evp.predictors.Predictors.AdaBoost"]], "classifier (class in evp.predictors)": [[8, "evp.predictors.Classifier"]], "estimatedvaluepredictor (class in evp.evp)": [[8, "evp.evp.EstimatedValuePredictor"]], "invalid (evp.predictors.merchantsizebydpv attribute)": [[8, "evp.predictors.MerchantSizeByDPV.Invalid"]], "knn (evp.predictors.predictors attribute)": [[8, "evp.predictors.Predictors.KNN"]], "knnclassifier (class in evp.predictors)": [[8, "evp.predictors.KNNClassifier"]], "l (evp.predictors.merchantsizebydpv attribute)": [[8, "evp.predictors.MerchantSizeByDPV.L"]], "lightgbm (class in evp.predictors)": [[8, "evp.predictors.LightGBM"]], "lightgbm (evp.predictors.predictors attribute)": [[8, "evp.predictors.Predictors.LightGBM"]], "m (evp.predictors.merchantsizebydpv attribute)": [[8, "evp.predictors.MerchantSizeByDPV.M"]], "merchantsizebydpv (class in evp.predictors)": [[8, "evp.predictors.MerchantSizeByDPV"]], "naivebayes (evp.predictors.predictors attribute)": [[8, "evp.predictors.Predictors.NaiveBayes"]], "naivebayesclassifier (class in evp.predictors)": [[8, "evp.predictors.NaiveBayesClassifier"]], "predictors (class in evp.predictors)": [[8, "evp.predictors.Predictors"]], "randomforest (class in evp.predictors)": [[8, "evp.predictors.RandomForest"]], "randomforest (evp.predictors.predictors attribute)": [[8, "evp.predictors.Predictors.RandomForest"]], "s (evp.predictors.merchantsizebydpv attribute)": [[8, "evp.predictors.MerchantSizeByDPV.S"]], "xgb (class in evp.predictors)": [[8, "evp.predictors.XGB"]], "xgboost (evp.predictors.predictors attribute)": [[8, "evp.predictors.Predictors.XGBoost"]], "xl (evp.predictors.merchantsizebydpv attribute)": [[8, "evp.predictors.MerchantSizeByDPV.XL"]], "xs (evp.predictors.merchantsizebydpv attribute)": [[8, "evp.predictors.MerchantSizeByDPV.XS"]], "evp": [[8, "module-evp"]], "evp.evp": [[8, "module-evp.evp"]], "evp.predictors": [[8, "module-evp.predictors"]], "lead_classifier (evp.evp.estimatedvaluepredictor attribute)": [[8, "evp.evp.EstimatedValuePredictor.lead_classifier"]], "load() (evp.predictors.classifier method)": [[8, "evp.predictors.Classifier.load"]], "predict() (evp.evp.estimatedvaluepredictor method)": [[8, "evp.evp.EstimatedValuePredictor.predict"]], "predict() (evp.predictors.adaboost method)": [[8, "evp.predictors.AdaBoost.predict"]], "predict() (evp.predictors.classifier method)": [[8, "evp.predictors.Classifier.predict"]], "predict() (evp.predictors.knnclassifier method)": [[8, "evp.predictors.KNNClassifier.predict"]], "predict() (evp.predictors.lightgbm method)": [[8, "evp.predictors.LightGBM.predict"]], "predict() (evp.predictors.naivebayesclassifier method)": [[8, "evp.predictors.NaiveBayesClassifier.predict"]], "predict() (evp.predictors.randomforest method)": [[8, "evp.predictors.RandomForest.predict"]], "predict() (evp.predictors.xgb method)": [[8, "evp.predictors.XGB.predict"]], "save() (evp.predictors.classifier method)": [[8, "evp.predictors.Classifier.save"]], "save_model() (evp.evp.estimatedvaluepredictor method)": [[8, "evp.evp.EstimatedValuePredictor.save_model"]], "train() (evp.evp.estimatedvaluepredictor method)": [[8, "evp.evp.EstimatedValuePredictor.train"]], "train() (evp.predictors.adaboost method)": [[8, "evp.predictors.AdaBoost.train"]], "train() (evp.predictors.classifier method)": [[8, "evp.predictors.Classifier.train"]], "train() (evp.predictors.knnclassifier method)": [[8, "evp.predictors.KNNClassifier.train"]], "train() (evp.predictors.lightgbm method)": [[8, "evp.predictors.LightGBM.train"]], "train() (evp.predictors.naivebayesclassifier method)": [[8, "evp.predictors.NaiveBayesClassifier.train"]], "train() (evp.predictors.randomforest method)": [[8, "evp.predictors.RandomForest.train"]], "train() (evp.predictors.xgb method)": [[8, "evp.predictors.XGB.train"]], "customlogger (class in logger.logger)": [[10, "logger.logger.CustomLogger"]], "formats (logger.logger.stdoutformatter attribute)": [[10, "logger.logger.StdOutFormatter.FORMATS"]], "fileoutformatter (class in logger.logger)": [[10, "logger.logger.FileOutFormatter"]], "stdoutformatter (class in logger.logger)": [[10, "logger.logger.StdOutFormatter"]], "add_file_handler() (logger.logger.customlogger method)": [[10, "logger.logger.CustomLogger.add_file_handler"]], "blue (logger.logger.stdoutformatter attribute)": [[10, "logger.logger.StdOutFormatter.blue"]], "bold_red (logger.logger.stdoutformatter attribute)": [[10, "logger.logger.StdOutFormatter.bold_red"]], "disable_console_output() (logger.logger.customlogger method)": [[10, "logger.logger.CustomLogger.disable_console_output"]], "disable_file_output() (logger.logger.customlogger method)": [[10, "logger.logger.CustomLogger.disable_file_output"]], "enable_console_output() (logger.logger.customlogger method)": [[10, "logger.logger.CustomLogger.enable_console_output"]], "enable_file_output() (logger.logger.customlogger method)": [[10, "logger.logger.CustomLogger.enable_file_output"]], "fmt (logger.logger.fileoutformatter attribute)": [[10, "logger.logger.FileOutFormatter.fmt"]], "fmt (logger.logger.stdoutformatter attribute)": [[10, "logger.logger.StdOutFormatter.fmt"]], "format() (logger.logger.fileoutformatter method)": [[10, "logger.logger.FileOutFormatter.format"]], "format() (logger.logger.stdoutformatter method)": [[10, "logger.logger.StdOutFormatter.format"]], "get_logger() (in module logger)": [[10, "logger.get_logger"]], "grey (logger.logger.stdoutformatter attribute)": [[10, "logger.logger.StdOutFormatter.grey"]], "has_console_handler() (logger.logger.customlogger method)": [[10, "logger.logger.CustomLogger.has_console_handler"]], "has_file_handler() (logger.logger.customlogger method)": [[10, "logger.logger.CustomLogger.has_file_handler"]], "logger": [[10, "module-logger"]], "logger.logger": [[10, "module-logger.logger"]], "red (logger.logger.stdoutformatter attribute)": [[10, "logger.logger.StdOutFormatter.red"]], "reset (logger.logger.stdoutformatter attribute)": [[10, "logger.logger.StdOutFormatter.reset"]], "yellow (logger.logger.stdoutformatter attribute)": [[10, "logger.logger.StdOutFormatter.yellow"]], "main": [[11, "module-main"]], "preprocessing (class in preprocessing.preprocessing)": [[13, "preprocessing.preprocessing.Preprocessing"]], "class_label_encoding() (preprocessing.preprocessing.preprocessing method)": [[13, "preprocessing.preprocessing.Preprocessing.class_label_encoding"]], "fill_missing_values() (preprocessing.preprocessing.preprocessing method)": [[13, "preprocessing.preprocessing.Preprocessing.fill_missing_values"]], "filter_out_null_data() (preprocessing.preprocessing.preprocessing method)": [[13, "preprocessing.preprocessing.Preprocessing.filter_out_null_data"]], "implement_preprocessing_pipeline() (preprocessing.preprocessing.preprocessing method)": [[13, "preprocessing.preprocessing.Preprocessing.implement_preprocessing_pipeline"]], "min_max_scaling() (preprocessing.preprocessing.preprocessing method)": [[13, "preprocessing.preprocessing.Preprocessing.min_max_scaling"]], "multiple_label_encoding() (preprocessing.preprocessing.preprocessing method)": [[13, "preprocessing.preprocessing.Preprocessing.multiple_label_encoding"]], "normalization() (preprocessing.preprocessing.preprocessing method)": [[13, "preprocessing.preprocessing.Preprocessing.normalization"]], "preprocessing": [[13, "module-preprocessing"]], "preprocessing.preprocessing": [[13, "module-preprocessing.preprocessing"]], "remove_outliers_zscore() (preprocessing.preprocessing.preprocessing method)": [[13, "preprocessing.preprocessing.Preprocessing.remove_outliers_zscore"]], "robust_scaling() (preprocessing.preprocessing.preprocessing method)": [[13, "preprocessing.preprocessing.Preprocessing.robust_scaling"]], "save_preprocessed_data() (preprocessing.preprocessing.preprocessing method)": [[13, "preprocessing.preprocessing.Preprocessing.save_preprocessed_data"]], "single_one_hot_encoding() (preprocessing.preprocessing.preprocessing method)": [[13, "preprocessing.preprocessing.Preprocessing.single_one_hot_encoding"]], "standard_scaling() (preprocessing.preprocessing.preprocessing method)": [[13, "preprocessing.preprocessing.Preprocessing.standard_scaling"]]}}) \ No newline at end of file