Twitter Recommendation Algorithm

Please note we have force-pushed a new initial commit in order to remove some publicly-available Twitter user information. Note that this process may be required in the future.
This commit is contained in:
twitter-team
2023-03-31 17:36:31 -05:00
commit ef4c5eb65e
5364 changed files with 460239 additions and 0 deletions

View File

@ -0,0 +1,38 @@
import os
TEAM_PROJECT = "twttr-toxicity-prod"
try:
from google.cloud import bigquery
except (ModuleNotFoundError, ImportError):
print("No Google packages")
CLIENT = None
else:
from google.auth.exceptions import DefaultCredentialsError
try:
CLIENT = bigquery.Client(project=TEAM_PROJECT)
except DefaultCredentialsError as e:
CLIENT = None
print("Issue at logging time", e)
TRAINING_DATA_LOCATION = f"..."
GCS_ADDRESS = "..."
LOCAL_DIR = os.getcwd()
REMOTE_LOGDIR = "{GCS_ADDRESS}/logs"
MODEL_DIR = "{GCS_ADDRESS}/models"
EXISTING_TASK_VERSIONS = {3, 3.5}
RANDOM_SEED = ...
TRAIN_EPOCHS = 4
MINI_BATCH_SIZE = 32
TARGET_POS_PER_EPOCH = 5000
PERC_TRAINING_TOX = ...
MAX_SEQ_LENGTH = 100
WARM_UP_PERC = 0.1
OUTER_CV = 5
INNER_CV = 5
NUM_PREFETCH = 5
NUM_WORKERS = 10