Skip to content

Commit a38f7b7

Browse files
authored
[Typos] Fix (#10651)
1 parent 5f5d9d4 commit a38f7b7

File tree

45 files changed

+50
-50
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+50
-50
lines changed

llm/utils/replace_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
_ReduceMode: TypeAlias = Literal['mean', 'sum', 'none']
3030

3131

32-
# TODO: this function is rewrited from paddle.nn.functional.cross_entropy,
32+
# TODO: this function is rewrote from paddle.nn.functional.cross_entropy,
3333
# but better to merge into only one.
3434
def parallel_cross_entropy(
3535
input: Tensor,

paddlenlp/rl/utils/bert_padding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def prepare_flashmask_inputs(
158158
input_ids_rmpad, indices, *_ = unpad_input(input_ids.unsqueeze(-1), attn_mask) # input_ids_rmpad (total_nnz, ...)
159159
input_ids_rmpad = input_ids_rmpad.transpose([1, 0])
160160

161-
# positon ids rmpad
161+
# position ids rmpad
162162
position_ids_rmpad = index_first_axis(
163163
rearrange(position_ids.unsqueeze(-1), "b s ... -> (b s) ..."), indices
164164
).transpose([1, 0])

scripts/unit_test/ci_unit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ if [[ ${FLAGS_enable_CI} == "true" ]] || [[ ${FLAGS_enable_CE} == "true" ]];then
112112
print_info $exit_code unittest
113113

114114
cd ${nlp_dir}
115-
echo -e "\033[35m ---- Genrate Allure Report \033[0m"
115+
echo -e "\033[35m ---- Generate Allure Report \033[0m"
116116
unset http_proxy && unset https_proxy
117117
cp scripts/regression/gen_allure_report.py ./
118118
python gen_allure_report.py > /dev/null

slm/applications/information_extraction/label_studio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def _save_examples(save_dir, file_name, examples):
121121

122122
parser.add_argument("--label_studio_file", default="./data/label_studio.json", type=str, help="The annotation file exported from label studio platform.")
123123
parser.add_argument("--save_dir", default="./data", type=str, help="The path of data that you wanna save.")
124-
parser.add_argument("--negative_ratio", default=5, type=int, help="Used only for the extraction task, the ratio of positive and negative samples, number of negtive samples = negative_ratio * number of positive samples")
124+
parser.add_argument("--negative_ratio", default=5, type=int, help="Used only for the extraction task, the ratio of positive and negative samples, number of negative samples = negative_ratio * number of positive samples")
125125
parser.add_argument("--splits", default=[0.8, 0.1, 0.1], type=float, nargs="*", help="The ratio of samples in datasets. [0.6, 0.2, 0.2] means 60% samples used for training, 20% for evaluation and 20% for test.")
126126
parser.add_argument("--task_type", choices=['ext', 'cls'], default="ext", type=str, help="Select task type, ext for the extraction task and cls for the classification task, defaults to ext.")
127127
parser.add_argument("--options", default=["正向", "负向"], type=str, nargs="+", help="Used only for the classification task, the options for classification")

slm/applications/text_classification/hierarchical/few-shot/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def compute_metrics(eval_preds):
9494
micro_f1_score, macro_f1_score = metric.accumulate()
9595
return {"micro_f1_score": micro_f1_score, "macro_f1_score": macro_f1_score}
9696

97-
# Deine the early-stopping callback.
97+
# Define the early-stopping callback.
9898
callbacks = [EarlyStoppingCallback(early_stopping_patience=4, early_stopping_threshold=0.0)]
9999

100100
# Initialize the trainer.

slm/applications/text_classification/hierarchical/few-shot/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
def load_local_dataset(data_path, splits, label_list):
2121
"""
22-
Load dataset for hierachical classification from files, where
22+
Load dataset for hierarchical classification from files, where
2323
there is one example per line. Text and label are separated
2424
by '\t', and multiple labels are delimited by ','.
2525

slm/applications/text_classification/multi_class/few-shot/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def compute_metrics(eval_preds):
9393
acc = metric.accumulate()
9494
return {"accuracy": acc}
9595

96-
# Deine the early-stopping callback.
96+
# Define the early-stopping callback.
9797
callbacks = [EarlyStoppingCallback(early_stopping_patience=4, early_stopping_threshold=0.0)]
9898

9999
# Initialize the trainer.

slm/applications/text_classification/multi_label/few-shot/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def compute_metrics(eval_preds):
9494
micro_f1_score, macro_f1_score = metric.accumulate()
9595
return {"micro_f1_score": micro_f1_score, "macro_f1_score": macro_f1_score}
9696

97-
# Deine the early-stopping callback.
97+
# Define the early-stopping callback.
9898
callbacks = [EarlyStoppingCallback(early_stopping_patience=4, early_stopping_threshold=0.0)]
9999

100100
# Initialize the trainer.

slm/examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ PaddleNLP provides rich application examples covering mainstream NLP task to hel
3131
| simultaneous_translation | [同声翻译 (Simultaneous Translation)](./simultaneous_translation/) |
3232
| machine_reading_comprehension | [阅读理解 (Machine Reading Comprehension)](./machine_reading_comprehension/) |
3333

34-
## NLP 拓展应用 (NLP Extented Applications)
34+
## NLP 拓展应用 (NLP Extended Applications)
3535

3636
| 目录 Folder | 任务 Task |
3737
|:---------------------|-------------------------------------------------------------------------|

slm/examples/benchmark/clue/grid_search_tools/grid_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def main():
151151
if returncode is not None:
152152
if returncode != 0:
153153
retry[runs[i]["ts"]] += 1
154-
print(f"> {runs[i]['ts']} task failed, will retried, tryed {retry[runs[i]['ts']]} times.")
154+
print(f"> {runs[i]['ts']} task failed, will retried, tried {retry[runs[i]['ts']]} times.")
155155
output = runs[i]["ps"].communicate()[0]
156156
for line in output.decode("utf-8").split("\n"):
157157
print(line)

slm/examples/benchmark/wiki_lambada/eval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def get_parser():
7474
help="Whether to use flash attention",
7575
)
7676
# load autodist name files, eg: bloom-176b
77-
parser.add_argument("--load_autodist", action="store_true", help="whether load auto-dist wieght file")
77+
parser.add_argument("--load_autodist", action="store_true", help="whether load auto-dist weight file")
7878

7979
return parser
8080

slm/examples/few_shot/RGL/data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def __init__(self, labels=None):
168168
@property
169169
def labels(self):
170170
if not getattr(self, "_labels"):
171-
raise ValueError("labels and label_mappings are not setted yet.")
171+
raise ValueError("labels and label_mappings are not set yet.")
172172
return self._labels
173173

174174
@labels.setter
@@ -179,7 +179,7 @@ def labels(self, labels):
179179
@property
180180
def label_mapping(self):
181181
if not getattr(self, "_labels"):
182-
raise ValueError("labels and label_mappings are not setted yet.")
182+
raise ValueError("labels and label_mappings are not set yet.")
183183
if not getattr(self, "_label_mapping"):
184184
self._label_mapping = {k: i for i, k in enumerate(self._labels)}
185185
return self._label_mapping

slm/examples/few_shot/RGL/verbalizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def aggregate(label_words_logits, atype="mean", ndim=2):
127127
elif atype == "first":
128128
return label_words_logits[..., 0, :]
129129
else:
130-
raise ValueError("Unsupported aggreate type {}".format(atype))
130+
raise ValueError("Unsupported aggregate type {}".format(atype))
131131
return label_words_logits
132132

133133
def normalize(self, logits):

slm/examples/information_extraction/DuIE/run_duie.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def do_train():
252252
print("\n=====start evaluating ckpt of %d steps=====" % global_step)
253253
precision, recall, f1 = evaluate(model, criterion, test_data_loader, eval_file_path, "eval")
254254
print("precision: %.2f\t recall: %.2f\t f1: %.2f\t" % (100 * precision, 100 * recall, 100 * f1))
255-
print("saving checkpoing model_%d.pdparams to %s " % (global_step, args.output_dir))
255+
print("saving checkpoint model_%d.pdparams to %s " % (global_step, args.output_dir))
256256
paddle.save(model.state_dict(), os.path.join(args.output_dir, "model_%d.pdparams" % global_step))
257257
model.train() # back to train mode
258258

slm/examples/information_extraction/DuIE/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def decoding(
6666
complex_relation_label = [8, 10, 26, 32, 46]
6767
complex_relation_affi_label = [9, 11, 27, 28, 29, 33, 47]
6868

69-
# flatten predictions then retrival all valid subject id
69+
# flatten predictions then retrieval all valid subject id
7070
flatten_predictions = []
7171
for layer_1 in predictions:
7272
for layer_2 in layer_1:

slm/examples/information_extraction/DuUIE/inference.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def main():
109109
"-c",
110110
"--config",
111111
dest="map_config",
112-
help="Offset mapping config, maping generated sel to offset record",
112+
help="Offset mapping config, mapping generated sel to offset record",
113113
default="longer_first_zh",
114114
)
115115
parser.add_argument("--verbose", action="store_true")

slm/examples/machine_translation/transformer/configs/transformer.base.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ label_smooth_eps: 0.1
6666
# select the top `beam_size * 2` beams and process the top `beam_size` alive
6767
# and finish beams in them separately, while 'v1' would only select the top
6868
# `beam_size` beams and mix up the alive and finish beams. 'v2' always
69-
# searchs more and get better results, since the alive beams would
69+
# searches more and get better results, since the alive beams would
7070
# always be `beam_size` while the number of alive beams in `v1` might
7171
# decrease when meeting the end token. However, 'v2' always generates
7272
# longer results thus might do more calculation and be slower.

slm/examples/machine_translation/transformer/configs/transformer.big.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ label_smooth_eps: 0.1
6666
# select the top `beam_size * 2` beams and process the top `beam_size` alive
6767
# and finish beams in them separately, while 'v1' would only select the top
6868
# `beam_size` beams and mix up the alive and finish beams. 'v2' always
69-
# searchs more and get better results, since the alive beams would
69+
# searches more and get better results, since the alive beams would
7070
# always be `beam_size` while the number of alive beams in `v1` might
7171
# decrease when meeting the end token. However, 'v2' always generates
7272
# longer results thus might do more calculation and be slower.

slm/examples/machine_translation/transformer/predict.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def do_predict(args):
126126

127127
# Define model
128128
# `TransformerGenerator` automatically chioces using `FastGeneration`
129-
# (with jit building) or the slower verison `InferTransformerModel`.
129+
# (with jit building) or the slower version `InferTransformerModel`.
130130
transformer = TransformerGenerator(
131131
src_vocab_size=args.src_vocab_size,
132132
trg_vocab_size=args.trg_vocab_size,

slm/examples/model_compression/distill_lstm/small.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__(
4343
):
4444
super(BiLSTM, self).__init__()
4545
if embedding_name is not None:
46-
raise ValueError("TokenEmbedding is depercated in PaddleNLP since 3.0, please set embedding_name to None ")
46+
raise ValueError("TokenEmbedding is deprecated in PaddleNLP since 3.0, please set embedding_name to None ")
4747
else:
4848
self.embedder = nn.Embedding(vocab_size, embed_dim, padding_idx)
4949

slm/examples/model_compression/pp-minilm/deploy/python/infer_perf.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
export task=TNEWS
1616

17-
echo Inference of orgin FP32 model
17+
echo Inference of origin FP32 model
1818
for ((i=0;i<=4;i++));
1919
do
2020
python infer.py --task_name ${task} --model_path ../finetuning/ppminilm-6l-768h/models/${task}/1e-4_64/inference --use_trt --perf

slm/examples/model_interpretation/rationale_extraction/generate_evaluation_data.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
###
16-
# This script concatenates results from previous running to generate a formated result for evaluation use
16+
# This script concatenates results from previous running to generate a formatted result for evaluation use
1717
###
1818

1919
BASE_MODEL=$1

slm/examples/model_interpretation/rationale_extraction/sentiment_pred.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def _read(self, filename, language):
9191

9292
def create_dataloader(dataset, trans_fn=None, mode="train", batch_size=1, batchify_fn=None):
9393
"""
94-
Creats dataloader.
94+
Creates dataloader.
9595
9696
Args:
9797
dataset(obj:`paddle.io.Dataset`): Dataset instance.

slm/examples/model_interpretation/task/mrc/saliency_map/rc_interpretable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ def extract_integrated_gradient_scores(
480480
out_handle,
481481
)
482482
else:
483-
raise KeyError(f"Unkonwn interpretable mode: {args.inter_mode}")
483+
raise KeyError(f"Unknown interpretable mode: {args.inter_mode}")
484484

485485
# Deal with last example
486486
if args.language == "ch":

slm/examples/model_interpretation/task/senti/LIME/lime_text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ def __init__(
371371
generate random numbers. If None, the random state will be
372372
initialized using the internal numpy seed.
373373
char_level: an boolean identifying that we treat each character
374-
as an independent occurence in the string
374+
as an independent occurrence in the string
375375
"""
376376

377377
if kernel is None:

slm/examples/model_interpretation/task/senti/rnn/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def set_seed(seed=1000):
5050

5151
def create_dataloader(dataset, trans_fn=None, mode="train", batch_size=1, batchify_fn=None):
5252
"""
53-
Creats dataloader.
53+
Creates dataloader.
5454
5555
Args:
5656
dataset(obj:`paddle.io.Dataset`): Dataset instance.

slm/examples/model_interpretation/task/senti/saliency_map/sentiment_interpretable.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def _read(self, filename):
9797

9898
def create_dataloader(dataset, trans_fn=None, mode="train", batch_size=1, batchify_fn=None):
9999
"""
100-
Creats dataloader.
100+
Creates dataloader.
101101
102102
Args:
103103
dataset(obj:`paddle.io.Dataset`): Dataset instance.
@@ -458,7 +458,7 @@ def extract_LIME_scores(
458458

459459
# Attention
460460
if args.inter_mode == "attention":
461-
# extract attention scores and write resutls to file
461+
# extract attention scores and write results to file
462462
extract_attention_scores(args, atts, input_ids, tokens, sub_word_id_dict, result, offset, out_handle)
463463

464464
# Integrated_gradient
@@ -496,7 +496,7 @@ def extract_LIME_scores(
496496
)
497497

498498
else:
499-
raise KeyError(f"Unkonwn interpretable mode: {args.inter_mode}")
499+
raise KeyError(f"Unknown interpretable mode: {args.inter_mode}")
500500

501501
if args.inter_mode == "lime":
502502
log.debug(np.average(np.array(lime_relative_err_total)))

slm/examples/model_interpretation/task/similarity/LIME/lime_text.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def __init__(
362362
generate random numbers. If None, the random state will be
363363
initialized using the internal numpy seed.
364364
char_level: an boolean identifying that we treat each character
365-
as an independent occurence in the string
365+
as an independent occurrence in the string
366366
"""
367367

368368
if kernel is None:

slm/examples/model_interpretation/task/similarity/saliency_map/similarity_interpretable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ def LIME_error_evaluation(
640640
)
641641

642642
else:
643-
raise KeyError(f"Unkonwn interpretable mode: {args.inter_mode}")
643+
raise KeyError(f"Unknown interpretable mode: {args.inter_mode}")
644644

645645
if args.inter_mode == "lime":
646646
print(np.average(np.array(lime_relative_err_total)))

slm/examples/model_interpretation/task/similarity/simnet/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949

5050
def create_dataloader(dataset, trans_fn=None, mode="train", batch_size=1, batchify_fn=None):
5151
"""
52-
Creats dataloader.
52+
Creates dataloader.
5353
5454
Args:
5555
dataset(obj:`paddle.io.Dataset`): Dataset instance.

slm/examples/model_interpretation/task/transformer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ def compute_kv(self, key, value):
264264

265265
def gen_cache(self, key, value=None, type=Cache):
266266
"""
267-
Generates cache for `forward` usage in inference accroding to arguments.
267+
Generates cache for `forward` usage in inference according to arguments.
268268
The generated cache is an instance of `MultiHeadAttention.Cache` or an
269269
instance of `MultiHeadAttention.StaticCache`.
270270
@@ -1063,7 +1063,7 @@ class Transformer(Layer):
10631063
Please refer to `Attention is all you need <http://papers.nips.cc/paper/7181-attention-is-all-you-need.pdf>`_ ,
10641064
and see `TransformerEncoder` and `TransformerDecoder` for more details.
10651065
1066-
Users can configurate the model architecture with corresponding parameters.
1066+
Users can configure the model architecture with corresponding parameters.
10671067
Note the usage of `normalize_before` representing where to apply layer
10681068
normalization (in pre-process or post-precess of multi-head attention or FFN),
10691069
and some transformer like models are different on this, such as

slm/examples/text_graph/erniesage/models/conv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def _recv_func(message):
153153
return self_feature, neigh_feature
154154

155155
def forward(self, graph, term_ids, act="relu"):
156-
"""Forward funciton of Conv layer.
156+
"""Forward function of Conv layer.
157157
158158
Args:
159159
graph (Graph): Graph object.

slm/examples/text_graph/erniesage/models/encoder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def take_final_feature(self, feature, index):
9595
"""Gather the final feature.
9696
9797
Args:
98-
feature (Tensor): the total featue tensor.
98+
feature (Tensor): the total feature tensor.
9999
index (Tensor): the index to gather.
100100
101101
Returns:

slm/examples/text_matching/ernie_matching/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
```
2020
ernie_matching/
21-
├── deply # 部署
21+
├── deploy # 部署
2222
| └── python
2323
| └── predict.py # python 预测部署示例
2424
├── export_model.py # 动态图参数导出静态图参数脚本

slm/examples/text_matching/sentence_transformers/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ PaddleNLP 提供了丰富的预训练模型,并且可以便捷地获取 Paddle
6262

6363
```text
6464
sentence_transformers/
65-
├── model.py # Sentence Transfomer 组网文件
65+
├── model.py # Sentence Transformer 组网文件
6666
├── README.md # 文本说明
6767
└── train.py # 模型训练评估
6868
```

slm/examples/text_matching/simcse/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ python -u -m paddle.distributed.launch --gpus '0' \
6161
可支持配置的参数:
6262

6363
* `infer_with_fc_pooler`:可选,在预测阶段计算文本 embedding 表示的时候网络前向是否会过训练阶段最后一层的 fc; 建议关闭模型效果最好。
64-
* `dup_rate`: 可选,word reptition 的比例,默认是0.32,根据论文 Word Repetition 比例采用 0.32 效果最佳。
64+
* `dup_rate`: 可选,word repetition 的比例,默认是0.32,根据论文 Word Repetition 比例采用 0.32 效果最佳。
6565
* `scale`:可选,在计算 cross_entropy loss 之前对 cosine 相似度进行缩放的因子;默认为 20。
6666
* `dropout`:可选,SimCSE 网络前向使用的 dropout 取值;默认 0.1。
6767
* `save_dir`:可选,保存训练模型的目录;默认保存在当前目录 checkpoints 文件夹下。

slm/examples/text_matching/simnet/train.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
def create_dataloader(dataset, trans_fn=None, mode="train", batch_size=1, batchify_fn=None):
4141
"""
42-
Creats dataloader.
42+
Creates dataloader.
4343
4444
Args:
4545
dataset(obj:`paddle.io.Dataset`): Dataset instance.

slm/examples/text_to_knowledge/nptag/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def levenstein_distance(s1: str, s2: str) -> int:
113113

114114

115115
class BurkhardKellerNode(object):
116-
"""Node implementatation for BK-Tree. A BK-Tree node stores the information of current word, and its approximate words calculated by levenstein distance.
116+
"""Node implementation for BK-Tree. A BK-Tree node stores the information of current word, and its approximate words calculated by levenstein distance.
117117
118118
Args:
119119
word (str): word of current node.

slm/examples/text_to_knowledge/termtree/termtree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
class TermTreeNode(object):
23-
"""Defination of term node. All members are protected, to keep rigorism of data struct.
23+
"""Definition of term node. All members are protected, to keep rigorism of data struct.
2424
2525
Args:
2626
sid (str): term id of node.
@@ -34,7 +34,7 @@ class TermTreeNode(object):
3434
Defaults to None.
3535
sub_type (Optional[List[str]], optional): grouped by some term. Defaults to None.
3636
sub_term (Optional[List[str]], optional): some lower term. Defaults to None.
37-
data (Optional[Dict[str, Any]], optional): to sore full imformation of a term. Defaults to None.
37+
data (Optional[Dict[str, Any]], optional): to sore full information of a term. Defaults to None.
3838
3939
"""
4040

0 commit comments

Comments
 (0)