Sentence Similarity
sentence-transformers
Safetensors
Chinese
bert
structural-isomorphism
cross-domain
analogy
text-embeddings-inference
Instructions to use qinghuiwan/structural-isomorphism-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use qinghuiwan/structural-isomorphism-v1 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("qinghuiwan/structural-isomorphism-v1") sentences = [ "那是 個快樂的人", "那是 條快樂的狗", "那是 個非常幸福的人", "今天是晴天" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,497 +1,93 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
tags:
|
| 3 |
-
- sentence-transformers
|
| 4 |
-
-
|
| 5 |
-
-
|
| 6 |
-
-
|
| 7 |
-
- generated_from_trainer
|
| 8 |
-
- dataset_size:7400
|
| 9 |
-
- loss:MultipleNegativesRankingLoss
|
| 10 |
base_model: shibing624/text2vec-base-chinese
|
| 11 |
-
widget:
|
| 12 |
-
- source_sentence: 在一条无限长的均匀管道中,流体在任何截面的行为都一样。这种沿管道方向的不变性直接保证了流量在管道中处处相等。正是因为没有哪个位置特殊,流体才不会在某处堆积或消散。
|
| 13 |
-
sentences:
|
| 14 |
-
- 一条法律规则如果对所有人一视同仁——不因身份、地位而区别对待——那么在这条规则下,所有人的权利总量保持均衡。平等对待的对称性直接导致权利分配的守恒。
|
| 15 |
-
- 一个极少地震的地区,地震仪几乎永远显示平静,每天的读数不传递新信息。但在地震活跃带,每次仪器读数都可能是不同强度和方向的震动,每条数据都在揭示地壳应力的新变化,监测价值远高于前者。
|
| 16 |
-
- 下棋时,你每一步都假设对手会走对他最有利的着法,然后在这种假设下选择对自己最有利的走法。对手也这样想。双方都做最坏打算后的最优选择,最终棋局会走向一个双方都无法改善的局面。
|
| 17 |
-
- source_sentence: 一条河流遭受污染后,下游的污染物浓度逐渐降低。最初几公里下降很快,但之后稀释速度放缓,残余污染在很长的河段上维持着低但可检测的浓度,远比预期消散得更慢。
|
| 18 |
-
sentences:
|
| 19 |
-
- 新修一条地铁线路后,沿线房价和人口不会立刻变化。三五年后居民逐渐迁入,商业配套慢慢成熟,片区终于繁荣起来。但此时交通压力又超出设计承载力,需要再次扩建,而扩建的效果又要等很多年才显现。
|
| 20 |
-
- 知识从教师集中的城市向师资匮乏的乡村扩散——通过支教、在线课程、教材传播。知识资源丰富的地方像高浓度溶液,自然向匮乏之处渗透,差距越大渗透的动力就越强。
|
| 21 |
-
- 一只股票在利空消息后暴跌,第一天跌幅最大。之后几天继续下跌但幅度递减,随后进入漫长的阴跌期——每天只跌一点点,但持续很久。这种缓慢出血比暴跌更让投资者煎熬。
|
| 22 |
-
- source_sentence: 今天的气温很大程度上取决于昨天和前天的气温,再加上一些随机扰动——比如一阵突然的冷风。天气预报之所以短期比较准、长期越来越不靠谱,就是因为每天的天气都是前几天天气的延续加上不可预测的新干扰的叠加。
|
| 23 |
-
sentences:
|
| 24 |
-
- 所有博主都在晚上八点发视频,因为这是流量高峰。如果你换到其他时段,观众更少;如果大家都在八点发,竞争虽然激烈但流量也最大。每个博主都没有动力单独改变发布时间。
|
| 25 |
-
- 脑电图记录了头皮表面的微弱电信号。把这个复杂信号拆解成频率成分后,发现不同状态下主导频率不同:清醒专注时以中高频为主,放松时以中低频为主,深睡时以极低频为主。大脑的活动状态可以通过频率成分的变化来判读。
|
| 26 |
-
- 今年的粮食产量与前几年有关——连续丰年后土壤肥力可能下降,连续歉收后农民会调整种植策略。每年的天气条件是不可预测的随机因素。农业产量的年际变化就是历史趋势的延续叠加上气候随机性的结果。
|
| 27 |
-
- source_sentence: 某些金属合金在高温下柔软易弯。当温度降到某个值时,内部结构突然重新排列,金属瞬间变得坚硬而脆。升温时恢复柔软的温度却比冷却时变硬的温度高出不少,两个转变温度之间存在明显的不对称。
|
| 28 |
-
sentences:
|
| 29 |
-
- 有机化学家要从简单原料合成目标药物分子,每一步反应都有不同的产率和成本。在所有可能的合成路线中,他们要找到步骤最少、总产率最高的那条反应路径。
|
| 30 |
-
- 热钱在全球市场中有一个主流方向——从低利率国家流向高利率国家。但每一笔具体的资金流向又带有投资者个体判断的随机性。宏观的利差驱动和微观的个体分散叠加,形成了资本流动的全貌。
|
| 31 |
-
- 暖湿气流和冷空气对峙时,天气在阴沉和放晴之间维持微妙的平衡。当冷空气势力刚好越过某个强度,锋面突然南压,天气从温暖直接跳变为寒潮。锋面过后气温回升的过程却是缓慢渐进的,冷暖转换不对等。
|
| 32 |
-
- source_sentence: 肥皂泡总是圆形的,因为球体是在给定体积下表面积最小的形状。肥皂膜的表面张力驱动它自动找到使总表面能量最低的形态。无需谁来计算,物理规律自动将泡泡推向这个最优形状。
|
| 33 |
-
sentences:
|
| 34 |
-
- 在一个人人收入相同的社会,你知道一个人的收入不会获得任何关于他身份的信息。但在收入差距大且分布均匀的社会,每了解一个人的收入都能帮你推断他的职业、教育和生活方式,信息量丰富得多。
|
| 35 |
-
- 国际冲突的爆发呈现出明显的丛集效应:和平年代可能持续几十年,然后短期内多场战争密集爆发。第一次世界大战结束二十年后就爆发了第二次。冲突不是随机均匀分布在历史时间轴上的,而是倾向于成簇出现。
|
| 36 |
-
- 金属冷却凝固时晶粒的边界不是随机的。晶粒界面自动调整到使总界面能量最小的构型。三个晶粒相遇的角度总是接近一百二十度,这不是巧合而是能量最优化的必然结果。
|
| 37 |
-
pipeline_tag: sentence-similarity
|
| 38 |
-
library_name: sentence-transformers
|
| 39 |
---
|
| 40 |
|
| 41 |
-
#
|
| 42 |
|
| 43 |
-
|
| 44 |
|
| 45 |
-
|
| 46 |
|
| 47 |
-
##
|
| 48 |
-
- **Model Type:** Sentence Transformer
|
| 49 |
-
- **Base model:** [shibing624/text2vec-base-chinese](https://huggingface.co/shibing624/text2vec-base-chinese) <!-- at revision 183bb99aa7af74355fb58d16edf8c13ae7c5433e -->
|
| 50 |
-
- **Maximum Sequence Length:** 128 tokens
|
| 51 |
-
- **Output Dimensionality:** 768 dimensions
|
| 52 |
-
- **Similarity Function:** Cosine Similarity
|
| 53 |
-
<!-- - **Training Dataset:** Unknown -->
|
| 54 |
-
<!-- - **Language:** Unknown -->
|
| 55 |
-
<!-- - **License:** Unknown -->
|
| 56 |
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
-
|
| 60 |
-
- **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
|
| 61 |
-
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
|
| 62 |
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
```
|
| 71 |
|
| 72 |
## Usage
|
| 73 |
|
| 74 |
-
###
|
| 75 |
-
|
| 76 |
-
First install the Sentence Transformers library:
|
| 77 |
|
| 78 |
-
```bash
|
| 79 |
-
pip install -U sentence-transformers
|
| 80 |
-
```
|
| 81 |
-
|
| 82 |
-
Then you can load this model and run inference.
|
| 83 |
```python
|
| 84 |
-
from sentence_transformers import SentenceTransformer
|
| 85 |
-
|
| 86 |
-
# Download from the 🤗 Hub
|
| 87 |
-
model = SentenceTransformer("sentence_transformers_model_id")
|
| 88 |
-
# Run inference
|
| 89 |
-
sentences = [
|
| 90 |
-
'肥皂泡总是圆形的,因为球体是在给定体积下表面积最小的形状。肥皂膜的表面张力驱动它自动找到使总表面能量最低的形态。无需谁来计算,物理规律自动将泡泡推向这个最优形状。',
|
| 91 |
-
'金属冷却凝固时晶粒的边界不是随机的。晶粒界面自动调整到使总界面能量最小的构型。三个晶粒相遇的角度总是接近一百二十度,这不是巧合而是能量最优化的必然结果。',
|
| 92 |
-
'国际冲突的爆发呈现出明显的丛集效应:和平年代可能持续几十年,然后短期内多场战争密集爆发。第一次世界大战结束二十年后就爆发了第二次。冲突不是随机均匀分布在历史时间轴上的,而是倾向于成簇出现。',
|
| 93 |
-
]
|
| 94 |
-
embeddings = model.encode(sentences)
|
| 95 |
-
print(embeddings.shape)
|
| 96 |
-
# [3, 768]
|
| 97 |
-
|
| 98 |
-
# Get the similarity scores for the embeddings
|
| 99 |
-
similarities = model.similarity(embeddings, embeddings)
|
| 100 |
-
print(similarities)
|
| 101 |
-
# tensor([[1.0000, 0.9134, 0.0324],
|
| 102 |
-
# [0.9134, 1.0000, 0.1733],
|
| 103 |
-
# [0.0324, 0.1733, 1.0000]])
|
| 104 |
-
```
|
| 105 |
-
|
| 106 |
-
<!--
|
| 107 |
-
### Direct Usage (Transformers)
|
| 108 |
-
|
| 109 |
-
<details><summary>Click to see the direct usage in Transformers</summary>
|
| 110 |
-
|
| 111 |
-
</details>
|
| 112 |
-
-->
|
| 113 |
-
|
| 114 |
-
<!--
|
| 115 |
-
### Downstream Usage (Sentence Transformers)
|
| 116 |
-
|
| 117 |
-
You can finetune this model on your own dataset.
|
| 118 |
-
|
| 119 |
-
<details><summary>Click to expand</summary>
|
| 120 |
-
|
| 121 |
-
</details>
|
| 122 |
-
-->
|
| 123 |
-
|
| 124 |
-
<!--
|
| 125 |
-
### Out-of-Scope Use
|
| 126 |
-
|
| 127 |
-
*List how the model may foreseeably be misused and address what users ought not to do with the model.*
|
| 128 |
-
-->
|
| 129 |
|
| 130 |
-
|
| 131 |
-
## Bias, Risks and Limitations
|
| 132 |
|
| 133 |
-
|
| 134 |
-
|
|
|
|
| 135 |
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
-->
|
| 141 |
-
|
| 142 |
-
## Training Details
|
| 143 |
-
|
| 144 |
-
### Training Dataset
|
| 145 |
-
|
| 146 |
-
#### Unnamed Dataset
|
| 147 |
-
|
| 148 |
-
* Size: 7,400 training samples
|
| 149 |
-
* Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>label</code>
|
| 150 |
-
* Approximate statistics based on the first 1000 samples:
|
| 151 |
-
| | sentence1 | sentence2 | label |
|
| 152 |
-
|:--------|:-----------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|:--------------------------------------------------------------|
|
| 153 |
-
| type | string | string | float |
|
| 154 |
-
| details | <ul><li>min: 66 tokens</li><li>mean: 88.8 tokens</li><li>max: 115 tokens</li></ul> | <ul><li>min: 66 tokens</li><li>mean: 88.35 tokens</li><li>max: 121 tokens</li></ul> | <ul><li>min: 1.0</li><li>mean: 1.0</li><li>max: 1.0</li></ul> |
|
| 155 |
-
* Samples:
|
| 156 |
-
| sentence1 | sentence2 | label |
|
| 157 |
-
|:-----------------------------------------------------------------------------------------------------------------|:----------------------------------------------------------------------------------------------------------|:-----------------|
|
| 158 |
-
| <code>急诊室里病人到达的时间没有任何规律。可能一个小时来六个人,下一个小时只来一个。但每个人来不来和其他人完全无关,平均下来每小时到达人数基本稳定。等待时间有时很短有时很长。</code> | <code>保险公司收到的理赔申请在时间上零散分布。本周三个下周可能七个,具体哪天收到完全不可预测。但年度总理赔数很稳定,每一起事故独立发生,一起理赔不影响下一起何时出现。</code> | <code>1.0</code> |
|
| 159 |
-
| <code>经济系统中几十个指标——GDP、失业率、通胀率——互相影响看似复杂。但分析后发现,它们的联动可以归结为几个独立的方向:一个方向代表经济周期,另一个方向代表结构调整。沿着这些方向看,经济的行为最简单。</code> | <code>股市里几千只股票每天的涨跌看似无序,但分析后发现大部分波动可以归结为几个主要方向——一个是大盘整体涨跌,一个是行业板块轮动。沿着这几个方向看,市场的行为变得最简单最可预测。</code> | <code>1.0</code> |
|
| 160 |
-
| <code>天气中既有持续几小时的雷暴这种短时高频事件,也有持续几天的冷锋这种中期过程,还有季节变化这种长期低频趋势。气象分析需要在不同时间尺度上同时观察——用小窗口看雷暴的精确时间,用大窗口看季节的整体趋势。</code> | <code>说话时辅音是短促的高频爆发持续几十毫秒,元音是持续较长的低频振动。语音识别需要同时精确定位短促辅音的出现时刻和长元音的频率特征。用短窗口分析辅音的时间细节,用长窗口分析元音的频率细节。</code> | <code>1.0</code> |
|
| 161 |
-
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
|
| 162 |
-
```json
|
| 163 |
-
{
|
| 164 |
-
"scale": 20.0,
|
| 165 |
-
"similarity_fct": "cos_sim",
|
| 166 |
-
"gather_across_devices": false
|
| 167 |
-
}
|
| 168 |
-
```
|
| 169 |
-
|
| 170 |
-
### Evaluation Dataset
|
| 171 |
-
|
| 172 |
-
#### Unnamed Dataset
|
| 173 |
-
|
| 174 |
-
* Size: 823 evaluation samples
|
| 175 |
-
* Columns: <code>sentence1</code>, <code>sentence2</code>, and <code>label</code>
|
| 176 |
-
* Approximate statistics based on the first 823 samples:
|
| 177 |
-
| | sentence1 | sentence2 | label |
|
| 178 |
-
|:--------|:------------------------------------------------------------------------------------|:------------------------------------------------------------------------------------|:--------------------------------------------------------------|
|
| 179 |
-
| type | string | string | float |
|
| 180 |
-
| details | <ul><li>min: 66 tokens</li><li>mean: 88.98 tokens</li><li>max: 115 tokens</li></ul> | <ul><li>min: 66 tokens</li><li>mean: 88.22 tokens</li><li>max: 121 tokens</li></ul> | <ul><li>min: 1.0</li><li>mean: 1.0</li><li>max: 1.0</li></ul> |
|
| 181 |
-
* Samples:
|
| 182 |
-
| sentence1 | sentence2 | label |
|
| 183 |
-
|:----------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------|:-----------------|
|
| 184 |
-
| <code>一个人今天的情绪状态很大程度上延续昨天的情绪。心情好的惯性会持续几天,心情差也会低落一阵。但每天都可能遇到随机事件——收到好消息或坏消息——把情绪轨迹推离原来的方向。情绪的变化就是历史惯性加上每天的随机冲击。</code> | <code>一段文章中下一个词的选择很大程度上取决于前面几个词。说了因为就很可能接所以,说了虽然就很可能接但是。但作者偶尔会突破预期用一个意外的词制造效果。文本的生成像是对已有上下文的延续加上创造性的随机变化。</code> | <code>1.0</code> |
|
| 185 |
-
| <code>一个信号可以用随时间变化的波形来描述,也可以用各频率成分的强度来描述。这两种描述是同一信号的镜像刻画。在时间域里难以解决的问题转到频率域可能很简单,反之亦然。两种视角提供了看同一问题的对称方式。</code> | <code>国际贸易谈判中,出口国追求的高价恰好是进口国要避免的高价。出口方的最优策略和进口方的最优策略是同一个博弈的镜像刻画。谈判桌两边的分析虽然立场相反,但使用的逻辑框架完全对称。</code> | <code>1.0</code> |
|
| 186 |
-
| <code>一个社区从高度凝聚走向分散化的过程中,并不是某天突然崩解。在转折期,各种规模的社交圈子此起彼伏地形成又解散,小到三五个人大到上百人的聚集同时存在,群体行为的波动达到最大,各种规模的组织形态都能观察到。</code> | <code>某种合金在特定温度附近,微观结构表现出异常行为。原子排列的有序和无序区域在各个尺度上共存,从纳米到微米都能看到两种状态的混合。材料的比热容在这个温度附近出现异常尖峰,而且不同成分的合金在各自的临界温度附近表现出惊人的相似规律。</code> | <code>1.0</code> |
|
| 187 |
-
* Loss: [<code>MultipleNegativesRankingLoss</code>](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
|
| 188 |
-
```json
|
| 189 |
-
{
|
| 190 |
-
"scale": 20.0,
|
| 191 |
-
"similarity_fct": "cos_sim",
|
| 192 |
-
"gather_across_devices": false
|
| 193 |
-
}
|
| 194 |
-
```
|
| 195 |
-
|
| 196 |
-
### Training Hyperparameters
|
| 197 |
-
#### Non-Default Hyperparameters
|
| 198 |
-
|
| 199 |
-
- `eval_strategy`: epoch
|
| 200 |
-
- `per_device_train_batch_size`: 16
|
| 201 |
-
- `per_device_eval_batch_size`: 16
|
| 202 |
-
- `learning_rate`: 2e-05
|
| 203 |
-
- `num_train_epochs`: 10
|
| 204 |
-
- `warmup_ratio`: 0.1
|
| 205 |
-
- `use_mps_device`: True
|
| 206 |
-
- `dataloader_pin_memory`: False
|
| 207 |
|
| 208 |
-
###
|
| 209 |
-
<details><summary>Click to expand</summary>
|
| 210 |
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
- `eval_strategy`: epoch
|
| 214 |
-
- `prediction_loss_only`: True
|
| 215 |
-
- `per_device_train_batch_size`: 16
|
| 216 |
-
- `per_device_eval_batch_size`: 16
|
| 217 |
-
- `per_gpu_train_batch_size`: None
|
| 218 |
-
- `per_gpu_eval_batch_size`: None
|
| 219 |
-
- `gradient_accumulation_steps`: 1
|
| 220 |
-
- `eval_accumulation_steps`: None
|
| 221 |
-
- `torch_empty_cache_steps`: None
|
| 222 |
-
- `learning_rate`: 2e-05
|
| 223 |
-
- `weight_decay`: 0.0
|
| 224 |
-
- `adam_beta1`: 0.9
|
| 225 |
-
- `adam_beta2`: 0.999
|
| 226 |
-
- `adam_epsilon`: 1e-08
|
| 227 |
-
- `max_grad_norm`: 1.0
|
| 228 |
-
- `num_train_epochs`: 10
|
| 229 |
-
- `max_steps`: -1
|
| 230 |
-
- `lr_scheduler_type`: linear
|
| 231 |
-
- `lr_scheduler_kwargs`: None
|
| 232 |
-
- `warmup_ratio`: 0.1
|
| 233 |
-
- `warmup_steps`: 0
|
| 234 |
-
- `log_level`: passive
|
| 235 |
-
- `log_level_replica`: warning
|
| 236 |
-
- `log_on_each_node`: True
|
| 237 |
-
- `logging_nan_inf_filter`: True
|
| 238 |
-
- `save_safetensors`: True
|
| 239 |
-
- `save_on_each_node`: False
|
| 240 |
-
- `save_only_model`: False
|
| 241 |
-
- `restore_callback_states_from_checkpoint`: False
|
| 242 |
-
- `no_cuda`: False
|
| 243 |
-
- `use_cpu`: False
|
| 244 |
-
- `use_mps_device`: True
|
| 245 |
-
- `seed`: 42
|
| 246 |
-
- `data_seed`: None
|
| 247 |
-
- `jit_mode_eval`: False
|
| 248 |
-
- `bf16`: False
|
| 249 |
-
- `fp16`: False
|
| 250 |
-
- `fp16_opt_level`: O1
|
| 251 |
-
- `half_precision_backend`: auto
|
| 252 |
-
- `bf16_full_eval`: False
|
| 253 |
-
- `fp16_full_eval`: False
|
| 254 |
-
- `tf32`: None
|
| 255 |
-
- `local_rank`: 0
|
| 256 |
-
- `ddp_backend`: None
|
| 257 |
-
- `tpu_num_cores`: None
|
| 258 |
-
- `tpu_metrics_debug`: False
|
| 259 |
-
- `debug`: []
|
| 260 |
-
- `dataloader_drop_last`: False
|
| 261 |
-
- `dataloader_num_workers`: 0
|
| 262 |
-
- `dataloader_prefetch_factor`: None
|
| 263 |
-
- `past_index`: -1
|
| 264 |
-
- `disable_tqdm`: False
|
| 265 |
-
- `remove_unused_columns`: True
|
| 266 |
-
- `label_names`: None
|
| 267 |
-
- `load_best_model_at_end`: False
|
| 268 |
-
- `ignore_data_skip`: False
|
| 269 |
-
- `fsdp`: []
|
| 270 |
-
- `fsdp_min_num_params`: 0
|
| 271 |
-
- `fsdp_config`: {'min_num_params': 0, 'xla': False, 'xla_fsdp_v2': False, 'xla_fsdp_grad_ckpt': False}
|
| 272 |
-
- `fsdp_transformer_layer_cls_to_wrap`: None
|
| 273 |
-
- `accelerator_config`: {'split_batches': False, 'dispatch_batches': None, 'even_batches': True, 'use_seedable_sampler': True, 'non_blocking': False, 'gradient_accumulation_kwargs': None}
|
| 274 |
-
- `parallelism_config`: None
|
| 275 |
-
- `deepspeed`: None
|
| 276 |
-
- `label_smoothing_factor`: 0.0
|
| 277 |
-
- `optim`: adamw_torch_fused
|
| 278 |
-
- `optim_args`: None
|
| 279 |
-
- `adafactor`: False
|
| 280 |
-
- `group_by_length`: False
|
| 281 |
-
- `length_column_name`: length
|
| 282 |
-
- `project`: huggingface
|
| 283 |
-
- `trackio_space_id`: trackio
|
| 284 |
-
- `ddp_find_unused_parameters`: None
|
| 285 |
-
- `ddp_bucket_cap_mb`: None
|
| 286 |
-
- `ddp_broadcast_buffers`: False
|
| 287 |
-
- `dataloader_pin_memory`: False
|
| 288 |
-
- `dataloader_persistent_workers`: False
|
| 289 |
-
- `skip_memory_metrics`: True
|
| 290 |
-
- `use_legacy_prediction_loop`: False
|
| 291 |
-
- `push_to_hub`: False
|
| 292 |
-
- `resume_from_checkpoint`: None
|
| 293 |
-
- `hub_model_id`: None
|
| 294 |
-
- `hub_strategy`: every_save
|
| 295 |
-
- `hub_private_repo`: None
|
| 296 |
-
- `hub_always_push`: False
|
| 297 |
-
- `hub_revision`: None
|
| 298 |
-
- `gradient_checkpointing`: False
|
| 299 |
-
- `gradient_checkpointing_kwargs`: None
|
| 300 |
-
- `include_inputs_for_metrics`: False
|
| 301 |
-
- `include_for_metrics`: []
|
| 302 |
-
- `eval_do_concat_batches`: True
|
| 303 |
-
- `fp16_backend`: auto
|
| 304 |
-
- `push_to_hub_model_id`: None
|
| 305 |
-
- `push_to_hub_organization`: None
|
| 306 |
-
- `mp_parameters`:
|
| 307 |
-
- `auto_find_batch_size`: False
|
| 308 |
-
- `full_determinism`: False
|
| 309 |
-
- `torchdynamo`: None
|
| 310 |
-
- `ray_scope`: last
|
| 311 |
-
- `ddp_timeout`: 1800
|
| 312 |
-
- `torch_compile`: False
|
| 313 |
-
- `torch_compile_backend`: None
|
| 314 |
-
- `torch_compile_mode`: None
|
| 315 |
-
- `include_tokens_per_second`: False
|
| 316 |
-
- `include_num_input_tokens_seen`: no
|
| 317 |
-
- `neftune_noise_alpha`: None
|
| 318 |
-
- `optim_target_modules`: None
|
| 319 |
-
- `batch_eval_metrics`: False
|
| 320 |
-
- `eval_on_start`: False
|
| 321 |
-
- `use_liger_kernel`: False
|
| 322 |
-
- `liger_kernel_config`: None
|
| 323 |
-
- `eval_use_gather_object`: False
|
| 324 |
-
- `average_tokens_across_devices`: True
|
| 325 |
-
- `prompts`: None
|
| 326 |
-
- `batch_sampler`: batch_sampler
|
| 327 |
-
- `multi_dataset_batch_sampler`: proportional
|
| 328 |
-
- `router_mapping`: {}
|
| 329 |
-
- `learning_rate_mapping`: {}
|
| 330 |
|
| 331 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 332 |
|
| 333 |
-
##
|
| 334 |
-
<details><summary>Click to expand</summary>
|
| 335 |
|
| 336 |
-
|
| 337 |
-
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
| 0.3240 | 150 | 0.7355 | - |
|
| 341 |
-
| 0.4320 | 200 | 0.546 | - |
|
| 342 |
-
| 0.5400 | 250 | 0.4791 | - |
|
| 343 |
-
| 0.6479 | 300 | 0.3971 | - |
|
| 344 |
-
| 0.7559 | 350 | 0.3148 | - |
|
| 345 |
-
| 0.8639 | 400 | 0.3241 | - |
|
| 346 |
-
| 0.9719 | 450 | 0.2552 | - |
|
| 347 |
-
| 1.0 | 463 | - | 0.2700 |
|
| 348 |
-
| 1.0799 | 500 | 0.2515 | - |
|
| 349 |
-
| 1.1879 | 550 | 0.2607 | - |
|
| 350 |
-
| 1.2959 | 600 | 0.2093 | - |
|
| 351 |
-
| 1.4039 | 650 | 0.2755 | - |
|
| 352 |
-
| 1.5119 | 700 | 0.1779 | - |
|
| 353 |
-
| 1.6199 | 750 | 0.1862 | - |
|
| 354 |
-
| 1.7279 | 800 | 0.1645 | - |
|
| 355 |
-
| 1.8359 | 850 | 0.1676 | - |
|
| 356 |
-
| 1.9438 | 900 | 0.2098 | - |
|
| 357 |
-
| 2.0 | 926 | - | 0.1917 |
|
| 358 |
-
| 2.0518 | 950 | 0.2279 | - |
|
| 359 |
-
| 2.1598 | 1000 | 0.1753 | - |
|
| 360 |
-
| 2.2678 | 1050 | 0.181 | - |
|
| 361 |
-
| 2.3758 | 1100 | 0.1755 | - |
|
| 362 |
-
| 2.4838 | 1150 | 0.1633 | - |
|
| 363 |
-
| 2.5918 | 1200 | 0.13 | - |
|
| 364 |
-
| 2.6998 | 1250 | 0.1237 | - |
|
| 365 |
-
| 2.8078 | 1300 | 0.1911 | - |
|
| 366 |
-
| 2.9158 | 1350 | 0.1655 | - |
|
| 367 |
-
| 3.0 | 1389 | - | 0.1829 |
|
| 368 |
-
| 3.0238 | 1400 | 0.1548 | - |
|
| 369 |
-
| 3.1317 | 1450 | 0.1487 | - |
|
| 370 |
-
| 3.2397 | 1500 | 0.1692 | - |
|
| 371 |
-
| 3.3477 | 1550 | 0.1719 | - |
|
| 372 |
-
| 3.4557 | 1600 | 0.1541 | - |
|
| 373 |
-
| 3.5637 | 1650 | 0.1664 | - |
|
| 374 |
-
| 3.6717 | 1700 | 0.1451 | - |
|
| 375 |
-
| 3.7797 | 1750 | 0.163 | - |
|
| 376 |
-
| 3.8877 | 1800 | 0.1615 | - |
|
| 377 |
-
| 3.9957 | 1850 | 0.1445 | - |
|
| 378 |
-
| 4.0 | 1852 | - | 0.1837 |
|
| 379 |
-
| 4.1037 | 1900 | 0.1527 | - |
|
| 380 |
-
| 4.2117 | 1950 | 0.1439 | - |
|
| 381 |
-
| 4.3197 | 2000 | 0.1321 | - |
|
| 382 |
-
| 4.4276 | 2050 | 0.1593 | - |
|
| 383 |
-
| 4.5356 | 2100 | 0.1388 | - |
|
| 384 |
-
| 4.6436 | 2150 | 0.1434 | - |
|
| 385 |
-
| 4.7516 | 2200 | 0.1456 | - |
|
| 386 |
-
| 4.8596 | 2250 | 0.1568 | - |
|
| 387 |
-
| 4.9676 | 2300 | 0.1549 | - |
|
| 388 |
-
| 5.0 | 2315 | - | 0.1620 |
|
| 389 |
-
| 5.0756 | 2350 | 0.1736 | - |
|
| 390 |
-
| 5.1836 | 2400 | 0.1337 | - |
|
| 391 |
-
| 5.2916 | 2450 | 0.1221 | - |
|
| 392 |
-
| 5.3996 | 2500 | 0.1372 | - |
|
| 393 |
-
| 5.5076 | 2550 | 0.1682 | - |
|
| 394 |
-
| 5.6156 | 2600 | 0.1489 | - |
|
| 395 |
-
| 5.7235 | 2650 | 0.138 | - |
|
| 396 |
-
| 5.8315 | 2700 | 0.1197 | - |
|
| 397 |
-
| 5.9395 | 2750 | 0.139 | - |
|
| 398 |
-
| 6.0 | 2778 | - | 0.1673 |
|
| 399 |
-
| 6.0475 | 2800 | 0.1503 | - |
|
| 400 |
-
| 6.1555 | 2850 | 0.1441 | - |
|
| 401 |
-
| 6.2635 | 2900 | 0.1614 | - |
|
| 402 |
-
| 6.3715 | 2950 | 0.1179 | - |
|
| 403 |
-
| 6.4795 | 3000 | 0.1509 | - |
|
| 404 |
-
| 6.5875 | 3050 | 0.1467 | - |
|
| 405 |
-
| 6.6955 | 3100 | 0.141 | - |
|
| 406 |
-
| 6.8035 | 3150 | 0.1358 | - |
|
| 407 |
-
| 6.9114 | 3200 | 0.1639 | - |
|
| 408 |
-
| 7.0 | 3241 | - | 0.1586 |
|
| 409 |
-
| 7.0194 | 3250 | 0.1294 | - |
|
| 410 |
-
| 7.1274 | 3300 | 0.1344 | - |
|
| 411 |
-
| 7.2354 | 3350 | 0.1138 | - |
|
| 412 |
-
| 7.3434 | 3400 | 0.1409 | - |
|
| 413 |
-
| 7.4514 | 3450 | 0.1293 | - |
|
| 414 |
-
| 7.5594 | 3500 | 0.1088 | - |
|
| 415 |
-
| 7.6674 | 3550 | 0.1399 | - |
|
| 416 |
-
| 7.7754 | 3600 | 0.127 | - |
|
| 417 |
-
| 7.8834 | 3650 | 0.1448 | - |
|
| 418 |
-
| 7.9914 | 3700 | 0.1376 | - |
|
| 419 |
-
| 8.0 | 3704 | - | 0.1555 |
|
| 420 |
-
| 8.0994 | 3750 | 0.1171 | - |
|
| 421 |
-
| 8.2073 | 3800 | 0.1221 | - |
|
| 422 |
-
| 8.3153 | 3850 | 0.1406 | - |
|
| 423 |
-
| 8.4233 | 3900 | 0.1299 | - |
|
| 424 |
-
| 8.5313 | 3950 | 0.1363 | - |
|
| 425 |
-
| 8.6393 | 4000 | 0.117 | - |
|
| 426 |
-
| 8.7473 | 4050 | 0.1572 | - |
|
| 427 |
-
| 8.8553 | 4100 | 0.1213 | - |
|
| 428 |
-
| 8.9633 | 4150 | 0.1218 | - |
|
| 429 |
-
| 9.0 | 4167 | - | 0.1551 |
|
| 430 |
-
| 9.0713 | 4200 | 0.1333 | - |
|
| 431 |
-
| 9.1793 | 4250 | 0.1339 | - |
|
| 432 |
-
| 9.2873 | 4300 | 0.1477 | - |
|
| 433 |
-
| 9.3952 | 4350 | 0.1013 | - |
|
| 434 |
-
| 9.5032 | 4400 | 0.1241 | - |
|
| 435 |
-
| 9.6112 | 4450 | 0.1091 | - |
|
| 436 |
-
| 9.7192 | 4500 | 0.1077 | - |
|
| 437 |
-
| 9.8272 | 4550 | 0.1261 | - |
|
| 438 |
-
| 9.9352 | 4600 | 0.1396 | - |
|
| 439 |
-
| 10.0 | 4630 | - | 0.1545 |
|
| 440 |
|
| 441 |
-
|
| 442 |
|
| 443 |
-
|
| 444 |
-
-
|
| 445 |
-
-
|
| 446 |
-
- Transformers: 4.57.6
|
| 447 |
-
- PyTorch: 2.8.0
|
| 448 |
-
- Accelerate: 1.10.1
|
| 449 |
-
- Datasets: 4.5.0
|
| 450 |
-
- Tokenizers: 0.22.2
|
| 451 |
|
| 452 |
## Citation
|
| 453 |
|
| 454 |
-
### BibTeX
|
| 455 |
-
|
| 456 |
-
#### Sentence Transformers
|
| 457 |
```bibtex
|
| 458 |
-
@
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
year = "2019",
|
| 464 |
-
publisher = "Association for Computational Linguistics",
|
| 465 |
-
url = "https://arxiv.org/abs/1908.10084",
|
| 466 |
}
|
| 467 |
```
|
| 468 |
|
| 469 |
-
##
|
| 470 |
-
```bibtex
|
| 471 |
-
@misc{henderson2017efficient,
|
| 472 |
-
title={Efficient Natural Language Response Suggestion for Smart Reply},
|
| 473 |
-
author={Matthew Henderson and Rami Al-Rfou and Brian Strope and Yun-hsuan Sung and Laszlo Lukacs and Ruiqi Guo and Sanjiv Kumar and Balint Miklos and Ray Kurzweil},
|
| 474 |
-
year={2017},
|
| 475 |
-
eprint={1705.00652},
|
| 476 |
-
archivePrefix={arXiv},
|
| 477 |
-
primaryClass={cs.CL}
|
| 478 |
-
}
|
| 479 |
-
```
|
| 480 |
-
|
| 481 |
-
<!--
|
| 482 |
-
## Glossary
|
| 483 |
-
|
| 484 |
-
*Clearly define terms in order to be accessible across audiences.*
|
| 485 |
-
-->
|
| 486 |
-
|
| 487 |
-
<!--
|
| 488 |
-
## Model Card Authors
|
| 489 |
-
|
| 490 |
-
*Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
|
| 491 |
-
-->
|
| 492 |
-
|
| 493 |
-
<!--
|
| 494 |
-
## Model Card Contact
|
| 495 |
|
| 496 |
-
|
| 497 |
-
-->
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- zh
|
| 4 |
+
license: mit
|
| 5 |
+
library_name: sentence-transformers
|
| 6 |
+
pipeline_tag: sentence-similarity
|
| 7 |
tags:
|
| 8 |
+
- sentence-transformers
|
| 9 |
+
- structural-isomorphism
|
| 10 |
+
- cross-domain
|
| 11 |
+
- analogy
|
|
|
|
|
|
|
|
|
|
| 12 |
base_model: shibing624/text2vec-base-chinese
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
---
|
| 14 |
|
| 15 |
+
# structural-isomorphism/structural-v1
|
| 16 |
|
| 17 |
+
A sentence-transformer model fine-tuned for **structural similarity** -- recognizing that phenomena from completely different domains share the same underlying structure.
|
| 18 |
|
| 19 |
+
Unlike standard semantic similarity models that match by surface vocabulary, this model maps descriptions with the same structural pattern close together in embedding space, regardless of domain.
|
| 20 |
|
| 21 |
+
## Model Description
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
- **Base model**: [shibing624/text2vec-base-chinese](https://huggingface.co/shibing624/text2vec-base-chinese) (BERT-based, 768-dim)
|
| 24 |
+
- **Training data**: [SIBD](https://huggingface.co/datasets/structural-isomorphism/SIBD) -- 1,214 descriptions across 84 structural types
|
| 25 |
+
- **Training objective**: MultipleNegativesRankingLoss (positive pairs = same structural type, different domain)
|
| 26 |
+
- **Epochs**: 10 | **Batch size**: 16 | **Learning rate**: 2e-5 | **Warmup**: 10%
|
| 27 |
|
| 28 |
+
## Evaluation Results
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
| Metric | Base Model | This Model | Improvement |
|
| 31 |
+
|---|---|---|---|
|
| 32 |
+
| Silhouette Score | -0.012 | **0.847** | +0.859 |
|
| 33 |
+
| Retrieval@5 | 20.3% | **100.0%** | +79.7% |
|
| 34 |
+
| Retrieval@10 | 18.0% | **100.0%** | +82.0% |
|
| 35 |
+
| Intra-class Similarity | 0.643 | **0.933** | +0.290 |
|
| 36 |
+
| Inter-class Similarity | 0.569 | **0.174** | -0.395 |
|
|
|
|
| 37 |
|
| 38 |
## Usage
|
| 39 |
|
| 40 |
+
### With sentence-transformers
|
|
|
|
|
|
|
| 41 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
```python
|
| 43 |
+
from sentence_transformers import SentenceTransformer, util
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
+
model = SentenceTransformer("structural-isomorphism/structural-v1")
|
|
|
|
| 46 |
|
| 47 |
+
# Encode two descriptions from different domains
|
| 48 |
+
emb1 = model.encode("A thermostat detects low temperature and turns on heating")
|
| 49 |
+
emb2 = model.encode("The pancreas detects high blood sugar and releases insulin")
|
| 50 |
|
| 51 |
+
similarity = util.cos_sim(emb1, emb2).item()
|
| 52 |
+
print(f"Structural similarity: {similarity:.3f}")
|
| 53 |
+
# Both are negative feedback loops -> high similarity
|
| 54 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
+
### With the search engine
|
|
|
|
| 57 |
|
| 58 |
+
```python
|
| 59 |
+
from structural_isomorphism import StructuralSearch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
+
search = StructuralSearch()
|
| 62 |
+
results = search.query("Small input causes disproportionately large output")
|
| 63 |
+
for r in results[:5]:
|
| 64 |
+
print(f"{r['name']} ({r['domain']}) - {r['score']:.3f}")
|
| 65 |
+
```
|
| 66 |
|
| 67 |
+
## Intended Use
|
|
|
|
| 68 |
|
| 69 |
+
- Cross-domain structural similarity search
|
| 70 |
+
- Finding analogies and inspiration across fields
|
| 71 |
+
- Scientific discovery: identifying unknown structural connections
|
| 72 |
+
- Educational tools for teaching structural thinking
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
|
| 74 |
+
## Limitations
|
| 75 |
|
| 76 |
+
- Language: Currently trained on Chinese text only
|
| 77 |
+
- Domain coverage: 84 structural types may not cover all possible patterns
|
| 78 |
+
- The model recognizes structural types present in training data; novel structural types may not be well represented
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
|
| 80 |
## Citation
|
| 81 |
|
|
|
|
|
|
|
|
|
|
| 82 |
```bibtex
|
| 83 |
+
@article{structural-isomorphism-2026,
|
| 84 |
+
title={Structural Isomorphism Search: Cross-Domain Structural Similarity Retrieval via Fine-tuned Embeddings},
|
| 85 |
+
author={Wan, Qihang},
|
| 86 |
+
journal={arXiv preprint arXiv:XXXX.XXXXX},
|
| 87 |
+
year={2026}
|
|
|
|
|
|
|
|
|
|
| 88 |
}
|
| 89 |
```
|
| 90 |
|
| 91 |
+
## License
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
+
MIT
|
|
|