| Use Case | TF-IDF | BM25 |
|---|---|---|
| Simple scoring model | ✅ | ✅ |
| Accurate relevance for modern search | ❌ | ✅ |
| Normalize for document length | ❌ | ✅ |
| Tune scoring behavior with parameters | ❌ | ✅ |
Notes for software engineering meeting presentation
- mid to late 2000s: appearance of Document stores / NoSQL databases such as Mongo, Couch
- Relational DBs now have support for document data: JSON in MySQL, JSON and JSONB in PostgreSQL
- Focus on JSONB in Postgres (most full featured)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import phonenumbers | |
| from pydantic.validators import strict_str_validator | |
| class PhoneNumber(str): | |
| """Phone Number Pydantic type, using google's phonenumbers""" | |
| @classmethod | |
| def __get_validators__(cls): | |
| yield strict_str_validator | |
| yield cls.validate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import Any | |
| from typing import Dict | |
| from typing import Set | |
| from typing import Type | |
| from pydantic import SecretStr | |
| from pydantic.utils import update_not_none | |
| class Password(SecretStr): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Add in ~/.bashrc or ~/.bash_profile | |
| function parse_git_branch () { | |
| git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
| } | |
| RED="\[\033[01;31m\]" | |
| YELLOW="\[\033[01;33m\]" | |
| GREEN="\[\033[01;32m\]" | |
| BLUE="\[\033[01;34m\]" | |
| NO_COLOR="\[\033[00m\]" |