From b5bba188562d9203a16a896cf0570b6360e68df5 Mon Sep 17 00:00:00 2001 From: Utsav Dave Date: Mon, 3 Apr 2023 22:23:54 -0400 Subject: [PATCH 1/2] Fixed typo --- navi/thrift_bpr_adapter/thrift/src/decoder.rs | 2 +- .../search/earlybird/exception/CriticalExceptionHandler.java | 2 +- .../search/earlybird/partition/SimpleStreamIndexer.java | 2 +- .../earlybird/queryparser/HighFrequencyTermPairExtractor.java | 2 +- src/thrift/com/twitter/simclusters_v2/abuse.thrift | 2 +- twml/twml/argument_parser.py | 4 ++-- twml/twml/contrib/trainers/trainer_utils.py | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/navi/thrift_bpr_adapter/thrift/src/decoder.rs b/navi/thrift_bpr_adapter/thrift/src/decoder.rs index 835d7d5d7..9e7cf1aca 100644 --- a/navi/thrift_bpr_adapter/thrift/src/decoder.rs +++ b/navi/thrift_bpr_adapter/thrift/src/decoder.rs @@ -8,7 +8,7 @@ enum FeatureVal { // A Feture has a name and a value // The name for now is 'id' of type string -// Eventually this needs to be flexible - example to accomodate feature-id +// Eventually this needs to be flexible - example to accommodate feature-id struct Feature { id: String, val: FeatureVal, diff --git a/src/java/com/twitter/search/earlybird/exception/CriticalExceptionHandler.java b/src/java/com/twitter/search/earlybird/exception/CriticalExceptionHandler.java index a2b72511f..9e5ae9069 100644 --- a/src/java/com/twitter/search/earlybird/exception/CriticalExceptionHandler.java +++ b/src/java/com/twitter/search/earlybird/exception/CriticalExceptionHandler.java @@ -101,7 +101,7 @@ public class CriticalExceptionHandler { try { Thread.sleep(3 * 60 * 1000); } catch (InterruptedException e) { - LOG.error(FATAL, "interupted sleep while shutting down."); + LOG.error(FATAL, "interrupted sleep while shutting down."); } LOG.info("Terminate JVM."); //CHECKSTYLE:OFF RegexpSinglelineJava diff --git a/src/java/com/twitter/search/earlybird/partition/SimpleStreamIndexer.java b/src/java/com/twitter/search/earlybird/partition/SimpleStreamIndexer.java index 7b4e72281..6f1d16bf7 100644 --- a/src/java/com/twitter/search/earlybird/partition/SimpleStreamIndexer.java +++ b/src/java/com/twitter/search/earlybird/partition/SimpleStreamIndexer.java @@ -175,7 +175,7 @@ public abstract class SimpleStreamIndexer { protected abstract void validateAndIndexRecord(ConsumerRecord record); - // Shutdown hook which can be called from a seperate thread. Calling consumer.wakeup() interrupts + // Shutdown hook which can be called from a separate thread. Calling consumer.wakeup() interrupts // the running indexer and causes it to first stop polling for new records before gracefully // closing the consumer. public void close() { diff --git a/src/java/com/twitter/search/earlybird/queryparser/HighFrequencyTermPairExtractor.java b/src/java/com/twitter/search/earlybird/queryparser/HighFrequencyTermPairExtractor.java index 83a928185..e2df49b40 100644 --- a/src/java/com/twitter/search/earlybird/queryparser/HighFrequencyTermPairExtractor.java +++ b/src/java/com/twitter/search/earlybird/queryparser/HighFrequencyTermPairExtractor.java @@ -31,7 +31,7 @@ import com.twitter.search.queryparser.query.annotation.Annotation; * opposite value of isPositive of the parent group. * * I'll try to break it down a bit further. Let's assume "a" and "b" are hf terms, and ' - * "[hf_term_pair a b]" represents querying their co-occurence. + * "[hf_term_pair a b]" represents querying their co-occurrence. * Query (* a b not_hf) can become (* [hf_term_pair a b] not_hf) * Query (+ -a -b -not_hf) can become (+ -[hf_term_pair a b] -not_hf) * These two rules represent the bulk of the rewrites that this class makes. diff --git a/src/thrift/com/twitter/simclusters_v2/abuse.thrift b/src/thrift/com/twitter/simclusters_v2/abuse.thrift index e7abf8415..40fd24ae9 100644 --- a/src/thrift/com/twitter/simclusters_v2/abuse.thrift +++ b/src/thrift/com/twitter/simclusters_v2/abuse.thrift @@ -29,7 +29,7 @@ struct AdhocSingleSideClusterScores { * we implement will use search abuse reports and impressions. We can build stores for new values * in the future. * -* The consumer creates the interactions which the author recieves. For instance, the consumer +* The consumer creates the interactions which the author receives. For instance, the consumer * creates an abuse report for an author. The consumer scores are related to the interation creation * behavior of the consumer. The author scores are related to the whether the author receives these * interactions. diff --git a/twml/twml/argument_parser.py b/twml/twml/argument_parser.py index c771eebdf..4db1fe89a 100644 --- a/twml/twml/argument_parser.py +++ b/twml/twml/argument_parser.py @@ -411,7 +411,7 @@ def get_trainer_parser(): action=parse_comma_separated_list(element_type=float), default=None, help="Required for 'piecewise_constant_values' learning_rate_decay. " - "A list of comma seperated floats or ints that specifies the values " + "A list of comma separated floats or ints that specifies the values " "for the intervals defined by boundaries. It should have one more " "element than boundaries.") parser_piecewise_constant.add_argument( @@ -419,7 +419,7 @@ def get_trainer_parser(): action=parse_comma_separated_list(element_type=int), default=None, help="Required for 'piecewise_constant_values' learning_rate_decay. " - "A list of comma seperated integers, with strictly increasing entries.") + "A list of comma separated integers, with strictly increasing entries.") # Create the parser for the "inverse_learning_rate_decay_fn" parser_inverse = subparsers.add_parser('inverse_learning_rate_decay', diff --git a/twml/twml/contrib/trainers/trainer_utils.py b/twml/twml/contrib/trainers/trainer_utils.py index f279571be..5d71a7422 100644 --- a/twml/twml/contrib/trainers/trainer_utils.py +++ b/twml/twml/contrib/trainers/trainer_utils.py @@ -56,7 +56,7 @@ def build_keras_trainer( metrics_fn: metrics function used by TensorFlow estimators. Defaults to twml.metrics.get_binary_class_metric_fn(). - **kwargs: for people familiar with twml Trainer's options, they can be passed in here + **kwargs: for people familar with twml Trainer's options, they can be passed in here as kwargs, and they will be forwarded to Trainer as opts. See https://cgit.twitter.biz/source/tree/twml/twml/argument_parser.py#n43 for available args. From 393938d7f44044369cdd951306377d33fd4fb033 Mon Sep 17 00:00:00 2001 From: Utsav Dave Date: Tue, 4 Apr 2023 08:40:49 -0400 Subject: [PATCH 2/2] Updated trainer_utils.py --- twml/twml/contrib/trainers/trainer_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twml/twml/contrib/trainers/trainer_utils.py b/twml/twml/contrib/trainers/trainer_utils.py index 5d71a7422..f279571be 100644 --- a/twml/twml/contrib/trainers/trainer_utils.py +++ b/twml/twml/contrib/trainers/trainer_utils.py @@ -56,7 +56,7 @@ def build_keras_trainer( metrics_fn: metrics function used by TensorFlow estimators. Defaults to twml.metrics.get_binary_class_metric_fn(). - **kwargs: for people familar with twml Trainer's options, they can be passed in here + **kwargs: for people familiar with twml Trainer's options, they can be passed in here as kwargs, and they will be forwarded to Trainer as opts. See https://cgit.twitter.biz/source/tree/twml/twml/argument_parser.py#n43 for available args.