diff --git a/cr-mixer/server/src/main/scala/com/twitter/cr_mixer/CrMixerServer.scala b/cr-mixer/server/src/main/scala/com/twitter/cr_mixer/CrMixerServer.scala index 887aab83f..27a72a060 100644 --- a/cr-mixer/server/src/main/scala/com/twitter/cr_mixer/CrMixerServer.scala +++ b/cr-mixer/server/src/main/scala/com/twitter/cr_mixer/CrMixerServer.scala @@ -40,7 +40,7 @@ import com.twitter.cr_mixer.module.similarity_engine.ProducerBasedUnifiedSimilar import com.twitter.cr_mixer.module.similarity_engine.SimClustersANNSimilarityEngineModule import com.twitter.cr_mixer.module.similarity_engine.TweetBasedUnifiedSimilarityEngineModule import com.twitter.cr_mixer.module.similarity_engine.TweetBasedQigSimilarityEngineModule -import com.twitter.cr_mixer.module.similarity_engine.TweetBasedTwHINSimlarityEngineModule +import com.twitter.cr_mixer.module.similarity_engine.TweetBasedTwHINSimilarityEngineModule import com.twitter.cr_mixer.module.similarity_engine.TweetBasedUserAdGraphSimilarityEngineModule import com.twitter.cr_mixer.module.similarity_engine.TweetBasedUserTweetGraphSimilarityEngineModule import com.twitter.cr_mixer.module.similarity_engine.TweetBasedUserVideoGraphSimilarityEngineModule @@ -180,7 +180,7 @@ class CrMixerServer extends ThriftServer with Mtls with HttpServer with HttpMtls TripCandidateStoreModule, TwiceClustersMembersStoreModule, TweetBasedQigSimilarityEngineModule, - TweetBasedTwHINSimlarityEngineModule, + TweetBasedTwHINSimilarityEngineModule, TweetBasedUnifiedSimilarityEngineModule, TweetBasedUserAdGraphSimilarityEngineModule, TweetBasedUserTweetGraphSimilarityEngineModule, diff --git a/cr-mixer/server/src/main/scala/com/twitter/cr_mixer/module/similarity_engine/TweetBasedTwHINSimlarityEngineModule.scala b/cr-mixer/server/src/main/scala/com/twitter/cr_mixer/module/similarity_engine/TweetBasedTwHINSimlarityEngineModule.scala index cc9da4772..9cb639ca9 100644 --- a/cr-mixer/server/src/main/scala/com/twitter/cr_mixer/module/similarity_engine/TweetBasedTwHINSimlarityEngineModule.scala +++ b/cr-mixer/server/src/main/scala/com/twitter/cr_mixer/module/similarity_engine/TweetBasedTwHINSimlarityEngineModule.scala @@ -21,7 +21,7 @@ import com.twitter.cr_mixer.similarity_engine.SimilarityEngine.SimilarityEngineC import com.twitter.cr_mixer.thriftscala.SimilarityEngineType import com.twitter.finagle.memcached.{Client => MemcachedClient} -object TweetBasedTwHINSimlarityEngineModule extends TwitterModule { +object TweetBasedTwHINSimilarityEngineModule extends TwitterModule { @Provides @Named(ModuleNames.TweetBasedTwHINANNSimilarityEngine) def providesTweetBasedTwHINANNSimilarityEngine( diff --git a/navi/thrift_bpr_adapter/thrift/src/decoder.rs b/navi/thrift_bpr_adapter/thrift/src/decoder.rs index 835d7d5d7..615fa37d6 100644 --- a/navi/thrift_bpr_adapter/thrift/src/decoder.rs +++ b/navi/thrift_bpr_adapter/thrift/src/decoder.rs @@ -6,7 +6,7 @@ enum FeatureVal { FloatVector(Vec), } -// A Feture has a name and a value +// A Feature 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 struct Feature { diff --git a/src/java/com/twitter/search/earlybird_root/common/EarlybirdFeatureSchemaMerger.java b/src/java/com/twitter/search/earlybird_root/common/EarlybirdFeatureSchemaMerger.java index f91d2d3c4..6a2d0f489 100644 --- a/src/java/com/twitter/search/earlybird_root/common/EarlybirdFeatureSchemaMerger.java +++ b/src/java/com/twitter/search/earlybird_root/common/EarlybirdFeatureSchemaMerger.java @@ -149,7 +149,7 @@ public class EarlybirdFeatureSchemaMerger { * (This is done inside superroot) * @param requestContext the search request context * @param mergedResponse the merged result inside the superroot - * @param realtimeResponse the realtime tier resposne + * @param realtimeResponse the realtime tier response * @param protectedResponse the protected tier response * @param fullArchiveResponse the full archive tier response * @param statsPrefix diff --git a/twml/libtwml/src/lib/TensorRecordReader.cpp b/twml/libtwml/src/lib/TensorRecordReader.cpp index 3ffb1b98a..f0d3bd41d 100644 --- a/twml/libtwml/src/lib/TensorRecordReader.cpp +++ b/twml/libtwml/src/lib/TensorRecordReader.cpp @@ -178,7 +178,7 @@ RawTensor TensorRecordReader::readStringTensor() { CHECK_THRIFT_TYPE(readByte(), TTYPE_STRING, "data_type"); length = readInt32(); // Store the current location of the byte stream. - // Use this at to "deocde strings" at a later point. + // Use this at to "decode strings" at a later point. data = getBuffer(); for (int32_t i = 0; i < length; i++) { // Skip reading the strings diff --git a/twml/twml/contrib/utils/math_fns.py b/twml/twml/contrib/utils/math_fns.py index 2d9e72282..2d986b3e7 100644 --- a/twml/twml/contrib/utils/math_fns.py +++ b/twml/twml/contrib/utils/math_fns.py @@ -7,7 +7,7 @@ from tensorflow.python.ops import array_ops, math_ops def safe_div(numerator, denominator, name=None): """ Example usage: calculating NDCG = DCG / IDCG to handle cases when - IDCG = 0 returns 0 instead of Infinity + IDCG = 0 returns 0 instead of Infinity Do not use this dividing funciton unless it makes sense to your problem Divides two tensors element-wise, returns 0 if the denominator is <= 0. Args: @@ -56,7 +56,7 @@ def cal_swapped_ndcg(label_scores, predicted_scores, top_k_int): Args: label_scores: a real `Tensor`. predicted_scores: a real `Tensor`, with dtype matching label_scores - top_k_int: An int or an int `Tensor`. + top_k_int: An int or an int `Tensor`. Returns: a `Tensor` that holds swapped NDCG by . """ @@ -100,7 +100,7 @@ def _dcg_idcg(relevance_scores, cg_discount): relevance_scores: a real `Tensor`. cg_discount: a real `Tensor`, with dtype matching relevance_scores Returns: - a `Tensor` that holds \\sum_{i=1}^k \frac{relevance_scores_k}{cg_discount} + a `Tensor` that holds \\sum_{i=1}^k \frac{relevance_scores_k}{cg_discount} """ # cg_discount is safe dcg_k = relevance_scores / cg_discount @@ -115,8 +115,8 @@ def _get_ranking_orders(label_scores, predicted_scores, top_k_int=1): predicted_scores: a real `Tensor`, with dtype matching label_scores top_k_int: an integer or an int `Tensor`. Returns: - two `Tensors` that hold sorted_labels: the ground truth relevance socres - and predicted_order: relevance socres based on sorted predicted_scores + two `Tensors` that hold sorted_labels: the ground truth relevance scores + and predicted_order: relevance scores based on sorted predicted_scores """ # sort predictions_scores and label_scores # size [batch_size/num of DataRecords, 1] @@ -141,7 +141,7 @@ def _get_cg_discount(top_k_int=1): Args: top_k_int: An int or an int `Tensor`. Returns: - a `Tensor` that holds \log_{2}(i + 1), i \in [1, k] + a `Tensor` that holds \log_{2}(i + 1), i \in [1, k] """ log_2 = tf.log(tf.constant(2.0, dtype=tf.float32)) # top_k_range needs to start from 1 to top_k_int