我有一个CMS,其中有一个用于组织地址的文本字段。数据存储非常不一致,在许多情况下,我只处理城市/州。我是schema.org的新手,想知道是否可以简单地执行以下操作来处理标记:
<p itemprop="address">Some city, WY</p>
Run Code Online (Sandbox Code Playgroud)
就像我说的那样,我是新手,但是我想我使用的是“ Microdata”格式。
我已经在这个问题上看到了另一个类似的问题,但是没有接受正确的答案或示例。此元素的格式应该是什么?BreadcrumbList有充分的文档证明,其中包含列表,但不包含SiteNavigationElement。
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SiteNavigationElement",
"@graph": [
{
"@type": "ListItem",
"position": 1,
"item": {
"@id": "http://www.example.com/",
"url": "http://www.example.com/",
"name": "Home"
}
},
{
"@type": "ListItem",
"position": 2,
"item": {
"@id": "http://www.example.com/contact.html",
"url": "http://www.example.com/contact.html",
"name": "Contact"
}
},
]
}
</script>
Run Code Online (Sandbox Code Playgroud)
更新:
一直在玩,并想出了一些可行的方法。但是它的结构正确吗?
<script type="application/ld+json">
//<![CDATA[
{
"@context": "https:\/\/schema.org\/",
"@type": "SiteNavigationElement",
"headline": "Headline for Site Navigation",
"name": [
"Home",
"Tours",
"Transfers",
"Taxis",
"Contact"
],
"description": [
"Homes Desc.",
"Tours Desc.",
"Transfers Desc.",
"Taxis Desc.",
"Contact Desc."
],
"url": …Run Code Online (Sandbox Code Playgroud) Schema.org、Goodrelations-vocabulary.org 和 Productontology.org 之间是什么关系?
Schema.org 告知,“W3C schema.org 社区组是该项目的主要论坛”。谷歌、微软、雅虎和 Yandex 都是创始公司。
Google、Microsoft、Yahoo 和 Yandex 是否也接受 Goodrelations-vocabulary.org 和 Productontology.org 标准?如果没有,将来使用它们是个好主意吗?
虽然谷歌没有提到,但我读到谷歌处理结构化数据的方法存在一些差异。Schema.org 提供 Microdata,Google 提供 application/ld+json 等。
不可能说 Google 100% 适合 Schema.org。微软、雅虎和 Yandex 也是如此。
在 Schema.org 上没有发布“游艇宪章”的结构化方式,唯一的方式是http://www.productontology.org/doc/Yacht_charter,但这不是官方的(直到今天 13.03.2018)。
为游艇租赁行业发布结构化数据的最佳方式是什么?
我们是否必须使用Offer,AggregateOffer或http://www.productontology.org/doc/Yacht_charter?
格式约定在 JSON-LD 表示法中使用不止一种类型是否有效?像这儿:
{
"@context": "http://schema.org",
"@type":
[
"MusicalEvent",
"CreativeWork"
],
"name": "Name",
"url": "http://example.com"
}
Run Code Online (Sandbox Code Playgroud)
谢谢!
我正在尝试使用 Tensorflow/Keras 练习我的机器学习技能,但是我在拟合模型方面遇到了麻烦。让我解释一下我做了什么以及我在哪里。
我正在使用来自 Kaggle 的哥斯达黎加家庭贫困水平预测挑战的数据集
由于我只是想熟悉 Tensorflow 工作流程,因此我通过删除一些包含大量缺失数据的列来清理数据集,然后用它们的平均值填充其他列。所以我的数据集中没有缺失值。
接下来,我make_csv_dataset从 TF中使用 using 加载了新的、清理过的 csv 。
batch_size = 32
train_dataset = tf.data.experimental.make_csv_dataset(
'clean_train.csv',
batch_size,
column_names=column_names,
label_name=label_name,
num_epochs=1)
Run Code Online (Sandbox Code Playgroud)
我设置了一个函数来返回我编译的模型,如下所示:
f1_macro = tfa.metrics.F1Score(num_classes=4, average='macro')
def get_compiled_model():
model = tf.keras.Sequential([
tf.keras.layers.Dense(512, activation=tf.nn.relu, input_shape=(137,)), # input shape required
tf.keras.layers.Dense(256, activation=tf.nn.relu),
tf.keras.layers.Dense(4, activation=tf.nn.softmax)
])
model.compile(optimizer='adam',
loss='binary_crossentropy',
metrics=[f1_macro, 'accuracy'])
return model
Run Code Online (Sandbox Code Playgroud)
model = get_compiled_model()
model.fit(train_dataset, epochs=15)
Run Code Online (Sandbox Code Playgroud)
下面是结果
我的笔记本的链接在这里
我应该提到,我的实现强烈基于 Tensorflow 的 iris 数据演练
谢谢!
我的网站上有近 1000 篇文章,这些文章是用 Umbraco 构建的,我想使用文章架构标记来实现它们。
我遇到的问题是大部分内容都是由剃刀动态生成的(例如 @Umbraco.Field("Title") )。我尝试将这些剃刀放入标记的相关代码中,但 Google 的结构化数据测试工具显示所有剃刀均存在错误。
这活一次还能活吗?或者是否有一种解决方法可以标记网站上的多篇文章以从页面上的其他区域提取数据?
感谢您的任何建议。
schema.org ×4
json-ld ×3
microdata ×2
html ×1
linked-data ×1
navigation ×1
python ×1
razor ×1
rdfa ×1
tensorflow ×1
umbraco ×1