AlaFalaki commited on
Commit
6f5e0fc
β€’
1 Parent(s): 5cf14c1

Created using Colab

Browse files
Files changed (1) hide show
  1. notebooks/Metadata_Filtering.ipynb +8 -5
notebooks/Metadata_Filtering.ipynb CHANGED
@@ -4,7 +4,7 @@
4
  "metadata": {
5
  "colab": {
6
  "provenance": [],
7
- "authorship_tag": "ABX9TyPf/kwiH4yYyYbpjHG8mnc3",
8
  "include_colab_link": true
9
  },
10
  "kernelspec": {
@@ -1155,11 +1155,11 @@
1155
  "nodes[0].metadata"
1156
  ],
1157
  "metadata": {
1158
- "id": "03xtKcBanBDL",
1159
- "outputId": "cea4fca1-f193-4f22-eade-b638888139b6",
1160
  "colab": {
1161
  "base_uri": "https://localhost:8080/"
1162
- }
 
 
1163
  },
1164
  "execution_count": 15,
1165
  "outputs": [
@@ -1327,12 +1327,15 @@
1327
  " MetadataFilter,\n",
1328
  " MetadataFilters,\n",
1329
  " FilterOperator,\n",
 
1330
  ")\n",
1331
  "\n",
1332
  "filters = MetadataFilters(\n",
1333
  " filters=[\n",
 
1334
  " MetadataFilter(key=\"source_name\", operator=FilterOperator.EQ, value=\"towards_ai\"),\n",
1335
- " ]\n",
 
1336
  ")"
1337
  ],
1338
  "metadata": {
 
4
  "metadata": {
5
  "colab": {
6
  "provenance": [],
7
+ "authorship_tag": "ABX9TyPWIgIsk3bTIAJVxT4+KJSy",
8
  "include_colab_link": true
9
  },
10
  "kernelspec": {
 
1155
  "nodes[0].metadata"
1156
  ],
1157
  "metadata": {
 
 
1158
  "colab": {
1159
  "base_uri": "https://localhost:8080/"
1160
+ },
1161
+ "id": "03xtKcBanBDL",
1162
+ "outputId": "cea4fca1-f193-4f22-eade-b638888139b6"
1163
  },
1164
  "execution_count": 15,
1165
  "outputs": [
 
1327
  " MetadataFilter,\n",
1328
  " MetadataFilters,\n",
1329
  " FilterOperator,\n",
1330
+ " FilterCondition\n",
1331
  ")\n",
1332
  "\n",
1333
  "filters = MetadataFilters(\n",
1334
  " filters=[\n",
1335
+ " MetadataFilter(key=\"excerpt_keywords\", operator=FilterOperator.TEXT_MATCH, value=\"model sizes\"),\n",
1336
  " MetadataFilter(key=\"source_name\", operator=FilterOperator.EQ, value=\"towards_ai\"),\n",
1337
+ " ],\n",
1338
+ " condition=FilterCondition.AND,\n",
1339
  ")"
1340
  ],
1341
  "metadata": {