Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Nächste Überarbeitung
Vorhergehende Überarbeitung
de:modul:ffit:3-jahr:java:learningunits:lu12:aufgaben:a01 [2025/11/23 22:39] – angelegt apeterde:modul:ffit:3-jahr:java:learningunits:lu12:aufgaben:a01 [2025/11/25 11:12] (aktuell) apeter
Zeile 1: Zeile 1:
-==== LU11.A02 pgvector installieren====+==== LU12.A01 pgvector installieren====
  
 Wie es der Zufall so will, gibt es eine Erweiterung für PostgreSQL names ''pgvector'', die eine Vektordatenbank ermöglicht. Wie es der Zufall so will, gibt es eine Erweiterung für PostgreSQL names ''pgvector'', die eine Vektordatenbank ermöglicht.
Zeile 5: Zeile 5:
 Installieren Sie die Erweiterung für PostgreSQL 17 folgendermassen: Installieren Sie die Erweiterung für PostgreSQL 17 folgendermassen:
   * https://github.com/andreiramani/pgvector_pgsql_windows/releases/tag/0.8.1_17.6 runterladen und readme.txt lesen   * https://github.com/andreiramani/pgvector_pgsql_windows/releases/tag/0.8.1_17.6 runterladen und readme.txt lesen
-  * Im korrekten Verzeichnis entpacken+  * Entpacken und ins korrekte Verzeichnis kopieren
   * Loggen Sie sich mit dem Superuser ein. <code bash>psql -U postgres</code>   * Loggen Sie sich mit dem Superuser ein. <code bash>psql -U postgres</code>
   * Erstellen Sie den Datentyp ''vector'' <code psql>CREATE EXTENSION vector;</code>   * Erstellen Sie den Datentyp ''vector'' <code psql>CREATE EXTENSION vector;</code>
   * Überprüfen Sie, ob die entsprechende Zeile vorhanden ist <code psql>SELECT extname,extrelocatable,extversion FROM pg_extension where extname='vector';</code>   * Überprüfen Sie, ob die entsprechende Zeile vorhanden ist <code psql>SELECT extname,extrelocatable,extversion FROM pg_extension where extname='vector';</code>
-  * Erstellen Sie die Tabelle ''documents'' <WRAP><code psql>CREATE TABLE documents ( 
-    id SERIAL PRIMARY KEY, 
-    content TEXT, 
-    embedding vector(384) -- number of dimensions 
-);</code></WRAP> 
-  * Überprüfen Sie, ob die Tabelle ''documents'' existiert. <WRAP><code psql>INSERT INTO documents (content) VALUES ('Dies ist ein Test.);'</code></WRAP> 
-  * Sie können Überprüfen, ob INSERT-Statements funktionieren. <WRAP><code psql>INSERT INTO documents (content) VALUES ('Dies ist ein Test.);'</code></WRAP> 
-  * In diesem Fall haben Sie einen Eintrag in der Tabelle <WRAP><code psql>Select count(*) from documents;</code></WRAP> 
-  * Leeren Sie die Tabelle für die richtigen Einträge <WRAP><code psql>Delete from documents;</code></WRAP> 
-  * <WRAP><code psql>INSERT INTO documents (content, embedding) VALUES ('Der Hund läuft durch den Park.', '[-0.01590, 0.05760, 0.10708, -0.05196, 0.04090, 0.06346, 0.06919, 0.05104, 0.00674, -0.01215, -0.01354, -0.01906, -0.03205, -0.13006, 0.01676, -0.00448, -0.09528, 0.10145, 0.09780, 0.01471, 0.01939, -0.05531, -0.02355, -0.01994, -0.05773, 0.04211, -0.06326, 0.01863, 0.00957, -0.03043, 0.05415, -0.03349, -0.03279, -0.02367, -0.01436, 0.03216, 0.00893, -0.10308, -0.01476, 0.09056, -0.12382, 0.02256, -0.00536, -0.03052, 0.01583, 0.00256, -0.02910, 0.06695, -0.03502, -0.04742, 0.07972, -0.02335, 0.14206, -0.02069, 0.02336, 0.00635, -0.06238, -0.03436, 0.03464, -0.03658, -0.00347, -0.03864, -0.06842, -0.02570, -0.02699, -0.10568, 0.04725, -0.02066, 0.00937, 0.05374, 0.03057, -0.02713, -0.04893, -0.02493, 0.03692, -0.01410, -0.04194, 0.00608, -0.03253, -0.14563, 0.02550, 0.00821, 0.00269, 0.02471, 0.08793, -0.04526, 0.01918, -0.00521, 0.01333, -0.02217, -0.04947, -0.02222, -0.11442, 0.02217, -0.01661, -0.00060, -0.00397, 0.04337, -0.00786, 0.04761, 0.01751, 0.08043, -0.03962, 0.03854, -0.03158, -0.08369, -0.02696, 0.00953, 0.01246, 0.01385, -0.00471, -0.02527, 0.03858, 0.03237, 0.00159, -0.02689, -0.02381, -0.15586, -0.04327, -0.02903, 0.03445, 0.02641, -0.05279, 0.05372, -0.01321, -0.02901, 0.04918, -0.00000, -0.07203, -0.07302, -0.01219, -0.00125, 0.03268, -0.00102, -0.07588, 0.01222, -0.02654, 0.08624, 0.02907, -0.00238, -0.05196, -0.10719, -0.01028, -0.01095, 0.05186, 0.02246, 0.05778, 0.00433, -0.06304, 0.09878, -0.00926, 0.05241, 0.06771, -0.10728, 0.02559, 0.02227, 0.00776, 0.03988, 0.00839, -0.04617, 0.01720, -0.02429, -0.00953, -0.05472, 0.01001, 0.07832, 0.01126, -0.03362, 0.05528, -0.05969, -0.02338, -0.06053, -0.00545, 0.08938, 0.09355, -0.00068, -0.01336, 0.00555, -0.03235, 0.02389, -0.15267, 0.00174, -0.04071, 0.01486, -0.05847, -0.02776, -0.01536, 0.07795, 0.00223, 0.10342, -0.01869, 0.00823, -0.00532, -0.07391, 0.10231, -0.00424, 0.02963, 0.08466, -0.04365, 0.00264, -0.00886, 0.04803, -0.01138, -0.00050, -0.06622, 0.12869, -0.06032, 0.03138, -0.09917, -0.05930, -0.02692, 0.02115, 0.01557, -0.01919, -0.01894, -0.01780, -0.02566, 0.03801, -0.04992, -0.02465, 0.02631, -0.05321, -0.04511, -0.00000, 0.05333, -0.03966, -0.00714, -0.02383, -0.06375, 0.20953, -0.05797, 0.04712, -0.12515, -0.00665, -0.04260, 0.02494, 0.07486, -0.01544, -0.02905, 0.02455, 0.05139, -0.00764, -0.09002, 0.05430, 0.00360, -0.00686, -0.00156, 0.07753, -0.04145, 0.02774, 0.08736, 0.03777, -0.06327, -0.02480, -0.02065, -0.03038, -0.00086, 0.03277, -0.00710, 0.01405, 0.07218, 0.03127, -0.04679, 0.05584, -0.02476, 0.00310, -0.02074, 0.01972, 0.07229, -0.01142, -0.10555, 0.02156, -0.08322, -0.00100, 0.06746, 0.00573, 0.02355, -0.08255, 0.07384, 0.01578, -0.07407, -0.02456, -0.06829, 0.02988, 0.09082, 0.08585, -0.07299, 0.02452, 0.02152, -0.08003, -0.10722, -0.02981, 0.06592, -0.01835, -0.00571, 0.06331, 0.05723, 0.01513, -0.06582, 0.03041, 0.08508, 0.02036, 0.00920, -0.00179, -0.03281, 0.00088, 0.07919, 0.01332, -0.05353, 0.01477, -0.00852, -0.04808, 0.01272, 0.01205, 0.03206, 0.01440, -0.04214, 0.03412, -0.03875, -0.00000, 0.03829, -0.00449, 0.00374, -0.00946, 0.01690, -0.11200, 0.01257, 0.00165, -0.09551, 0.04445, -0.03091, 0.07380, -0.04560, 0.05470, 0.01869, 0.02848, -0.00027, 0.02792, -0.02747, -0.00094, 0.02597, -0.05226, -0.01447, 0.03359, 0.01793, -0.03485, 0.03273, -0.10018, 0.04703, -0.06515, 0.06083, 0.09394, -0.05146, 0.01588, 0.03086, -0.03902, -0.01637, -0.00140, -0.01574, 0.09720, 0.00387, 0.10042, 0.07453, -0.02445, -0.01154, -0.01369, 0.00689, 0.04894, 0.04651, 0.00300, -0.05208, -0.01367, 0.03340, 0.06036, 0.01158, 0.03343, -0.01005, -0.06027, -0.05874, -0.03169, 0.04574, 0.02431, 0.07514, 0.06036]'); 
-</code></WRAP> 
-  * <WRAP><code psql>INSERT INTO documents (content, embedding) VALUES ('Eine Katze schläft auf dem warmen Sofa.', '[-0.00711, -0.00126, 0.02677, 0.01282, 0.04307, 0.07922, 0.01864, -0.00389, 0.02205, 0.01343, -0.05660, -0.04328, 0.03836, -0.06556, -0.00852, -0.12838, -0.05110, -0.00628, 0.05067, 0.01989, -0.04880, 0.00524, -0.00023, 0.01179, 0.01032, -0.06434, -0.00937, -0.01534, -0.02890, 0.00996, 0.08728, -0.00570, -0.04132, 0.00085, 0.02651, -0.01292, -0.03437, -0.10519, -0.10064, 0.04373, -0.07573, -0.05152, -0.08331, -0.09508, 0.00862, 0.06358, -0.05573, 0.00398, -0.03595, 0.01107, -0.01814, -0.05499, 0.06934, 0.02145, 0.06002, -0.00958, 0.03415, 0.05556, 0.02662, 0.00761, 0.00619, -0.00766, -0.07285, 0.00341, -0.04906, -0.02628, -0.00198, -0.04506, -0.04896, 0.03340, 0.02619, -0.06032, 0.03032, -0.02236, 0.01074, -0.07417, -0.01976, -0.03220, -0.04477, -0.07230, -0.00271, -0.00219, 0.00727, 0.01074, -0.05480, 0.03234, 0.06381, -0.02367, 0.01141, -0.01706, -0.00410, -0.02886, -0.06579, 0.00722, 0.01307, -0.01849, 0.04327, 0.04853, 0.00966, 0.07214, -0.01899, -0.00071, 0.05235, 0.06729, -0.07341, -0.06767, 0.02899, -0.04362, -0.03047, 0.01561, 0.02647, -0.04262, 0.04433, -0.05078, 0.02164, -0.03115, 0.05717, -0.11359, 0.03102, -0.03417, 0.07878, 0.05079, 0.03762, 0.09780, -0.00043, -0.02602, 0.03036, -0.00000, -0.08481, -0.00123, -0.00666, 0.01364, 0.04075, -0.03848, -0.08715, 0.06017, -0.00885, 0.05519, -0.01698, 0.05289, 0.00337, -0.04045, 0.02128, -0.03944, -0.02859, 0.06049, 0.07145, -0.01022, -0.08586, -0.02074, 0.07784, 0.08921, -0.00391, -0.05362, 0.03018, -0.03118, -0.11000, 0.01393, -0.00366, 0.00380, -0.02643, -0.01510, -0.08177, -0.01436, -0.00336, 0.08290, -0.02233, 0.03328, 0.07091, -0.01555, 0.03074, -0.02299, 0.02592, 0.08531, 0.00492, 0.05743, -0.00626, -0.03371, -0.01262, 0.01683, -0.02495, 0.01228, -0.04498, 0.10605, -0.01457, -0.00479, 0.01628, -0.00633, 0.00408, -0.00137, -0.02580, -0.05769, -0.04357, -0.02071, 0.01907, -0.03989, 0.03201, 0.02868, -0.08305, 0.06634, 0.15218, 0.00473, -0.00384, 0.03599, -0.03307, 0.11406, 0.00092, -0.03822, -0.02103, -0.06143, 0.00915, -0.03508, 0.04229, -0.09558, -0.07878, 0.03006, -0.08054, 0.03867, -0.02087, -0.09655, 0.00321, -0.03374, 0.00364, -0.00000, 0.06857, -0.04805, -0.03993, 0.06912, 0.00464, 0.10951, -0.06589, -0.00042, -0.09600, 0.02595, 0.03320, -0.06374, 0.06742, -0.07901, 0.02549, 0.05758, -0.00041, -0.05264, -0.00314, 0.01862, -0.02556, -0.06051, -0.02422, 0.06692, -0.03103, 0.02566, 0.04554, 0.09589, -0.07605, 0.01280, -0.02927, -0.06818, -0.01480, 0.03224, 0.02526, 0.08400, 0.02566, 0.05990, -0.00195, 0.03866, 0.02495, 0.04093, -0.01064, 0.03440, 0.11336, -0.01212, -0.16080, -0.03877, 0.00642, -0.03145, 0.02972, -0.01972, 0.01847, -0.06019, -0.01910, -0.00709, -0.04097, -0.01469, -0.04030, 0.06491, 0.08734, 0.12555, 0.04837, 0.05323, 0.01500, -0.08827, -0.14485, -0.09304, 0.07367, 0.03537, 0.06847, -0.00161, 0.00524, 0.04148, -0.09327, -0.02967, 0.11559, 0.06700, -0.02526, 0.08083, -0.02736, 0.03907, 0.05650, 0.04225, 0.05409, -0.04426, 0.07632, -0.02369, -0.01143, -0.05722, -0.00048, 0.07795, 0.03283, -0.00211, 0.03929, -0.00000, -0.00948, -0.05327, -0.05527, 0.06362, 0.07910, -0.17217, -0.09031, -0.06706, -0.06044, -0.04123, -0.01378, 0.00965, -0.01131, 0.09929, 0.04177, 0.09175, -0.08783, 0.03209, -0.01484, -0.04617, 0.03967, -0.04918, -0.00175, -0.06762, 0.02043, -0.03234, 0.00152, 0.01268, -0.01151, -0.02774, -0.08926, 0.04601, -0.07244, 0.01594, 0.04323, -0.02154, -0.02356, 0.00132, -0.02728, 0.02111, 0.02428, 0.04330, -0.00512, -0.12128, -0.00225, -0.03939, -0.00288, 0.03242, 0.07509, 0.12356, 0.02272, 0.05251, 0.03601, 0.06739, -0.01518, 0.01071, -0.02104, -0.00591, 0.05052, -0.02393, 0.04712, 0.05661, 0.02156, 0.03162]'); 
-</code></WRAP> 
-  * <WRAP><code psql>INSERT INTO documents (content, embedding) VALUES ('Programmierung in Java macht Spaß.', '[-0.04320, 0.09149, -0.02907, -0.06482, -0.03118, 0.00736, 0.05101, 0.12620, -0.09678, -0.06097, -0.04286, -0.04671, 0.05544, -0.06011, -0.00836, -0.07430, -0.03463, 0.03645, 0.01377, -0.06727, 0.01024, -0.06941, -0.02241, -0.03505, 0.00967, 0.06197, 0.03928, -0.01860, 0.00158, -0.00656, 0.01644, -0.01128, 0.06484, 0.04973, 0.01244, 0.06818, -0.03447, -0.02072, -0.02826, 0.03619, -0.15857, 0.03426, -0.05092, -0.01910, 0.03031, -0.03754, -0.06047, -0.01739, -0.03357, -0.01355, -0.12385, -0.07073, 0.01569, -0.10495, 0.01973, -0.02886, 0.08422, 0.05480, -0.03242, -0.06808, -0.00424, -0.03106, -0.11074, 0.02438, 0.00117, -0.07912, 0.06757, 0.01374, 0.06102, -0.05175, -0.03620, -0.00726, -0.04161, 0.06855, -0.11766, 0.01132, -0.00229, 0.03213, 0.00072, -0.06043, 0.01863, 0.01394, -0.05643, 0.05950, 0.00344, 0.03332, 0.00381, 0.00361, 0.10464, 0.10793, -0.00326, -0.03851, -0.05545, 0.02678, -0.07018, 0.02007, 0.01595, -0.00507, -0.00026, 0.07487, -0.02787, -0.01857, 0.08420, 0.00026, 0.01872, -0.06249, -0.00876, -0.01186, 0.06205, -0.05796, -0.00380, -0.06276, -0.00360, -0.04937, 0.05332, 0.05278, 0.05638, 0.01297, -0.02681, 0.03694, 0.07506, 0.02586, 0.00068, 0.00916, -0.02921, 0.01173, -0.02710, -0.00000, -0.01905, -0.15280, -0.01343, 0.04360, -0.05674, -0.03473, -0.00603, 0.07633, -0.01970, -0.03206, 0.02305, -0.02959, 0.01285, 0.03574, 0.09524, -0.08112, 0.02827, 0.01625, -0.07733, -0.06954, 0.05222, -0.01880, 0.01830, 0.02542, 0.03093, 0.00114, 0.07404, -0.03883, 0.02319, 0.05829, 0.03644, -0.04899, -0.09560, 0.08661, 0.01613, -0.02322, 0.02432, 0.00894, 0.08997, -0.07360, -0.01976, -0.06197, 0.03914, -0.05359, 0.06345, -0.01754, -0.03569, 0.04191, -0.01094, 0.03894, 0.01633, 0.04923, 0.06424, 0.03291, -0.01286, 0.04455, 0.00377, 0.01917, -0.03765, 0.05911, -0.05198, 0.05485, 0.01867, 0.01839, 0.00528, -0.03385, -0.03193, -0.08873, 0.02162, 0.08852, -0.06307, -0.02544, 0.02540, 0.05153, -0.04176, -0.03080, 0.03567, 0.05313, -0.12846, -0.07282, -0.07656, -0.05561, 0.02358, -0.08034, 0.02759, 0.03784, 0.02449, 0.02280, 0.04366, -0.01139, -0.00515, 0.04745, -0.06891, 0.07130, 0.01153, -0.00000, -0.02809, 0.01526, -0.09744, 0.01194, -0.03335, 0.06410, -0.04081, -0.00176, -0.08925, 0.04565, -0.09040, -0.01432, 0.00569, 0.04352, 0.00653, -0.01222, 0.04815, 0.02110, -0.06231, 0.02995, -0.01641, 0.03673, -0.04684, -0.02291, 0.03839, -0.06342, 0.00024, 0.06209, -0.03315, 0.05295, 0.06160, 0.03103, -0.08760, -0.02895, -0.01942, -0.05829, 0.10143, 0.08240, -0.00793, 0.07945, 0.05254, -0.04358, 0.00198, 0.11115, 0.03686, 0.03465, -0.08480, -0.02993, -0.04024, -0.04686, -0.01105, -0.04979, 0.11264, -0.04663, 0.00868, -0.02092, 0.00320, -0.01532, -0.03905, 0.04414, 0.00950, -0.04743, 0.08942, -0.04367, 0.04120, -0.00002, -0.06431, 0.02833, -0.03661, -0.02736, 0.05611, 0.05928, -0.03023, 0.05963, -0.06698, 0.01500, -0.00067, 0.02453, -0.06616, 0.00900, 0.08950, 0.05985, 0.04294, -0.04921, -0.03327, -0.04504, 0.04264, 0.04440, -0.08336, -0.03506, -0.01714, 0.13089, 0.08293, 0.03917, -0.01050, -0.00000, 0.02217, -0.06189, 0.02975, 0.04239, 0.09772, 0.02725, -0.08559, -0.00195, 0.00060, -0.01088, 0.00527, 0.05015, -0.03729, 0.10542, 0.05408, -0.03110, 0.02760, 0.00335, -0.04189, 0.06488, 0.08679, -0.03124, -0.05536, 0.09805, -0.00138, -0.03899, 0.05762, 0.04123, 0.04786, -0.00399, -0.01272, 0.09749, 0.04348, -0.01376, -0.07119, 0.09796, 0.00677, 0.02649, -0.00979, -0.01368, -0.01728, 0.01866, 0.00032, -0.04019, 0.00662, -0.05815, -0.04381, -0.05185, 0.01390, -0.01041, -0.09169, 0.06701, -0.01003, -0.04172, 0.02309, 0.06324, -0.01555, -0.09723, -0.03298, 0.07984, -0.06707, 0.02211, 0.03867, 0.01291]'); 
-</code></WRAP> 
-  * <WRAP><code psql>INSERT INTO documents (content, embedding) VALUES ('PostgreSQL ist eine leistungsfähige Datenbank.', '[-0.03429, 0.06173, -0.03975, 0.04145, -0.13126, 0.08621, 0.00319, 0.03005, 0.02991, -0.05117, -0.04699, 0.04494, -0.06536, -0.11712, -0.05831, -0.03202, -0.03093, 0.04725, 0.07477, -0.04728, -0.08303, -0.09535, -0.07372, 0.06229, -0.01554, -0.03045, 0.03512, -0.03472, -0.00566, -0.05086, -0.03260, 0.02053, 0.00268, 0.00175, 0.01844, 0.04087, 0.07505, -0.06817, -0.00669, -0.04954, -0.06285, -0.02958, -0.03496, 0.00985, 0.00384, -0.00861, 0.01516, 0.05489, -0.10802, 0.05866, -0.04387, 0.01079, 0.04925, -0.04233, 0.06288, -0.00771, -0.05741, -0.00522, 0.02249, 0.02093, 0.01000, 0.02915, -0.07094, 0.00470, -0.04696, -0.05301, 0.08767, -0.00060, 0.05788, -0.03261, 0.00762, 0.01103, -0.05033, 0.00664, -0.12247, 0.07863, -0.01307, -0.00867, 0.00905, -0.07175, 0.01002, 0.00153, -0.05467, 0.03779, -0.04065, -0.06465, -0.00931, 0.06274, -0.01006, -0.03775, 0.00558, 0.07641, -0.01715, 0.01494, -0.02367, -0.08040, 0.01042, 0.02684, 0.09627, 0.07352, 0.02585, 0.11794, -0.01239, 0.08656, -0.09040, -0.05076, -0.04871, -0.10463, 0.00778, 0.01017, -0.00876, -0.00884, -0.01377, -0.09049, 0.05491, 0.02176, -0.01173, -0.05618, 0.06138, -0.06323, 0.05558, 0.01370, 0.00106, -0.03077, -0.01695, 0.00426, 0.11145, 0.00000, -0.01202, -0.04827, 0.13671, -0.06535, -0.01604, -0.06013, 0.00468, -0.00589, 0.01689, 0.07291, -0.03153, -0.03819, -0.02570, -0.11258, 0.05101, 0.06928, -0.01854, 0.03407, 0.10890, 0.00512, 0.03370, -0.05489, -0.00358, 0.10547, 0.07028, -0.03498, 0.01182, 0.00162, 0.01408, 0.02239, 0.05972, -0.03349, -0.06217, 0.03234, 0.06371, -0.00949, -0.04787, 0.04037, 0.02349, 0.02598, 0.05811, -0.04757, -0.02338, -0.07412, 0.05797, 0.06830, 0.01898, -0.00709, 0.08436, -0.01178, -0.08683, -0.01899, -0.05214, 0.02430, 0.02977, 0.03940, -0.02171, -0.03022, 0.03671, 0.04785, 0.01935, -0.04217, -0.05305, -0.02807, -0.04319, -0.00436, -0.00642, 0.02296, 0.03615, 0.05378, -0.03141, 0.01154, 0.05067, 0.03298, -0.01094, 0.00116, -0.02965, 0.08282, -0.01046, 0.03991, -0.03255, -0.02745, -0.00858, -0.01008, -0.02097, 0.06187, 0.02063, 0.06393, -0.01959, 0.01639, -0.06338, 0.06820, 0.04937, 0.05954, 0.05427, -0.00000, -0.03163, -0.03699, -0.06069, 0.06353, 0.00068, 0.00493, -0.02719, 0.08729, -0.00329, 0.05034, -0.02068, -0.01700, 0.07002, 0.00851, -0.00563, 0.07312, -0.00705, -0.02048, -0.12685, 0.04062, -0.05809, 0.05376, -0.06523, -0.00163, 0.11719, -0.02240, 0.04088, 0.03741, -0.05736, 0.05935, 0.03757, -0.07742, 0.03090, 0.03066, -0.06035, -0.05338, 0.07963, -0.04046, 0.05022, 0.08698, -0.09134, 0.07421, -0.02496, -0.02369, 0.06774, 0.09304, -0.06478, -0.02399, -0.01144, -0.05802, -0.03668, 0.00622, -0.03913, -0.05955, 0.08552, 0.00956, -0.04334, 0.05085, 0.00232, -0.01426, -0.04774, 0.02829, 0.09394, -0.00823, 0.07830, -0.09227, 0.07673, -0.00887, 0.06290, -0.06586, 0.09524, 0.02547, 0.00277, 0.05460, -0.10717, 0.01665, -0.02714, 0.10181, -0.05907, -0.01473, -0.04846, 0.06107, 0.02659, 0.07890, -0.00959, -0.02693, 0.04252, -0.03587, -0.06534, -0.05752, -0.02028, 0.01663, -0.11825, 0.04655, -0.01455, -0.00000, -0.00500, -0.05158, -0.13957, 0.01721, 0.12876, -0.01686, -0.00114, 0.05691, 0.00581, -0.01137, 0.04161, -0.01209, -0.03758, 0.01474, -0.03496, -0.02583, -0.04028, -0.02732, -0.01253, -0.07391, 0.03684, -0.02612, 0.00628, -0.09552, -0.04351, 0.00467, -0.02151, 0.05898, 0.06443, -0.01818, 0.00470, 0.01940, 0.02307, -0.08359, 0.02374, 0.00692, 0.02899, 0.04387, -0.07812, 0.02586, 0.05448, 0.02687, 0.01435, 0.00365, -0.05989, -0.07411, -0.02148, -0.01677, -0.02766, 0.09163, -0.02525, 0.01594, 0.02753, 0.03219, 0.08931, 0.03065, -0.02586, -0.02974, -0.08107, -0.05400, -0.03935, -0.00705, 0.02187, 0.02754]'); 
-</code></WRAP> 
-  * Nun sollten 4 Einträge vorhanden sein <WRAP><code psql>Select count(*) from documents;</code></WRAP> 
-  * Setzen Sie folgendes SELECT-Statement ab, um die 3 nächsten Einträge zu finden, der am nächsten zum Satz "Katzen sind meine Lieblingstiere" ist <WRAP><code psql>SELECT id, content, embedding <=> '[-0.03493, 0.03568, 0.06867, 0.00082, -0.04072, 0.06786, 0.11940, -0.05452, 0.02797, -0.04935, 0.02574, 0.03369, -0.00755, -0.09016, -0.03898, -0.08418, -0.07572, 0.12806, -0.06438, -0.02141, 0.01308, -0.00135, 0.04206, -0.01135, -0.03226, 0.00674, 0.03916, -0.02778, -0.02183, -0.06194, 0.11493, 0.00412, -0.04840, -0.03430, 0.05279, -0.04752, -0.00842, -0.05732, -0.00380, 0.02335, -0.10179, -0.06320, -0.09921, -0.07888, -0.01643, 0.05722, -0.01505, 0.01265, -0.03972, -0.00492, -0.05816, -0.01095, 0.05496, -0.03182, 0.05747, -0.10006, -0.00392, 0.03742, 0.01361, 0.04257, 0.10364, -0.00892, -0.01067, -0.01833, 0.00142, -0.04466, 0.06020, -0.05770, -0.05920, 0.02491, 0.07516, -0.08650, -0.02995, 0.02948, -0.04823, -0.05966, -0.07892, -0.03719, -0.04004, -0.09690, 0.00099, -0.00529, 0.05824, 0.02274, -0.04542, -0.03596, 0.01114, 0.05981, 0.05816, 0.03222, -0.03906, -0.04377, -0.12412, 0.00144, 0.10311, -0.05397, 0.01379, -0.03965, -0.04770, 0.08296, -0.02025, 0.02099, 0.05772, 0.08974, -0.02686, -0.10557, 0.03211, -0.06085, -0.01258, -0.01620, 0.03423, 0.01051, 0.07322, -0.10282, 0.07545, 0.00329, 0.07935, -0.03416, -0.00551, -0.00736, 0.06363, 0.03952, 0.06159, 0.11851, 0.02391, -0.04287, -0.03800, 0.00000, -0.03656, -0.00219, -0.03037, -0.00321, 0.01003, -0.05004, -0.11151, 0.02934, -0.05327, 0.03419, -0.02941, -0.03520, 0.00116, -0.03742, 0.00228, 0.02429, 0.00155, 0.05357, 0.05857, -0.06630, -0.01104, -0.01960, 0.09703, 0.06629, 0.00076, -0.04037, 0.05239, -0.01468, -0.05098, 0.00862, 0.08488, -0.04264, -0.01979, -0.05946, 0.00002, 0.03357, -0.06341, 0.03716, -0.02466, 0.01536, 0.04432, -0.01202, -0.02409, -0.06403, 0.02127, 0.08715, -0.00143, -0.00101, 0.04289, 0.00666, -0.00493, 0.04477, -0.02715, 0.00680, -0.01724, 0.10950, -0.02329, 0.01558, -0.04293, -0.01325, 0.04967, -0.05981, -0.05935, -0.05094, -0.02633, -0.00977, 0.01927, -0.02305, -0.00257, 0.07690, -0.11992, -0.01335, 0.05334, 0.05576, 0.01851, 0.00626, -0.07686, 0.08395, -0.01366, -0.03389, -0.05128, -0.05843, -0.00856, -0.05903, 0.02409, 0.01240, -0.06948, -0.03939, -0.02406, 0.09140, 0.00454, -0.03415, 0.01524, -0.03230, -0.02853, -0.00000, -0.03648, 0.02080, -0.05858, 0.06433, 0.02325, 0.06574, -0.05850, 0.06955, -0.06247, 0.02721, 0.00924, -0.07342, 0.01695, 0.03598, -0.02073, 0.05871, 0.04333, -0.03323, 0.03020, 0.01873, -0.09406, 0.03331, -0.02906, -0.01306, -0.08289, 0.02105, 0.03742, 0.05806, -0.02792, 0.02196, 0.04866, -0.01016, -0.05985, -0.05076, 0.00396, 0.06116, 0.01258, 0.06670, -0.01775, 0.06748, -0.06249, 0.06749, -0.00955, 0.02280, 0.06887, -0.02375, -0.04198, -0.06005, -0.01574, -0.02914, -0.01564, 0.05372, 0.01805, -0.03720, 0.00938, -0.00115, -0.03708, -0.03602, -0.09096, 0.04249, 0.00143, 0.07988, 0.09154, 0.01241, 0.02756, -0.03852, -0.09470, 0.00696, 0.11326, 0.04225, 0.00439, -0.05702, 0.01846, -0.00595, -0.12662, 0.00903, 0.07057, 0.12596, -0.03087, 0.00775, 0.05668, 0.01745, -0.00602, 0.01471, 0.04832, -0.01996, 0.06925, 0.00526, -0.02115, -0.00283, 0.01880, 0.06725, 0.04957, -0.02828, -0.01660, -0.00000, -0.00526, -0.08733, -0.09355, 0.00189, 0.09745, -0.07254, -0.04005, 0.00660, -0.11776, -0.01369, -0.00677, 0.01250, -0.04336, 0.05627, 0.04264, 0.03474, -0.09913, 0.06409, 0.01374, 0.00799, 0.09462, -0.01017, 0.00585, -0.04287, -0.04398, 0.05375, 0.02274, -0.07671, -0.01552, 0.02560, 0.02374, 0.12028, -0.04550, -0.02612, -0.04541, -0.01518, -0.02856, 0.00332, -0.06168, 0.03811, 0.05920, 0.04857, 0.09972, -0.04516, -0.00653, -0.05994, -0.03416, -0.03662, 0.09364, 0.07119, -0.01380, 0.05634, 0.03041, 0.09184, 0.03038, 0.05970, 0.00352, -0.00548, -0.06134, 0.02853, 0.01593, 0.08125, 0.04185, -0.04225]' AS distance FROM documents ORDER BY distance ASC LIMIT 3;</code></WRAP> 
- 
-   
- 
  • de/modul/ffit/3-jahr/java/learningunits/lu12/aufgaben/a01.1763933988.txt.gz
  • Zuletzt geändert: 2025/11/23 22:39
  • von apeter