![]() |
AW: Ähnliche strings finden (wie z.B. google Suche)
|
AW: Ähnliche strings finden (wie z.B. google Suche)
Noch eine Option - aber auch das hängt vom Anwendungsfall ab - wäre via API ChatGPT (oder andere) zu fragen, ob zwei Worte ähnlich sind.
Zitat:
Zitat:
|
AW: Ähnliche strings finden (wie z.B. google Suche)
Code:
text = ["Meier", "Maier", "Mayer"]
test = embedding_model.encode(text) print(f"{text[0]} {text[1]} ", cosine_similarity(test[0], test[1])) text = ["tough", "though"] test = embedding_model.encode(text) print(f"{text[0]} {text[1]} ", cosine_similarity(test[0], test[1])) text = ["Baum", "Tanne"] test = embedding_model.encode(text) print(f"{text[0]} {text[1]} ", cosine_similarity(test[0], test[1])) text = ["Nadelbaum", "Laubbaum"] test = embedding_model.encode(text) print(f"{text[0]} {text[1]} ", cosine_similarity(test[0], test[1])) text = ["Hamster", "Goldfisch", "Schäferhund", "Dackel"] test = embedding_model.encode(text) print(f"{text[0]} {text[1]} ", cosine_similarity(test[0], test[1])) print(f"{text[2]} {text[3]} ", cosine_similarity(test[2], test[3])) text = ["Mann", "Frau", "Junge", "Bube", "Auto", "Haus"] test = embedding_model.encode(text) print(f"{text[0]} {text[1]} ", cosine_similarity(test[0], test[1])) print(f"{text[2]} {text[3]} ", cosine_similarity(test[2], test[3])) print(f"{text[4]} {text[5]} ", cosine_similarity(test[4], test[5]))
Code:
Ehrlich gesagt, hätte ich die Hunde in der Ähnlichkeit höher erwartet, als die anderen Tiere.
intfloat/multilingual-e5-large
Meier Maier 0.93333364 tough though 0.86950207 Baum Tanne 0.79528135 Nadelbaum Laubbaum 0.8690178 Hamster Goldfisch 0.80143225 Schäferhund Dackel 0.786349 Mann Frau 0.86286455 Junge Bube 0.83770347 Auto Haus 0.8216029 OK, passt doch
Code:
Alignment-Lab-AI/e5-mistral-7b-instruct
Meier Maier 0.93829346 tough though 0.7688065 Baum Tanne 0.90267164 Nadelbaum Laubbaum 0.88353676 Hamster Goldfisch 0.78831625 Schäferhund Dackel 0.844885 Mann Frau 0.84775054 Junge Bube 0.8940252 Auto Haus 0.67513704 Achtung, Alignment-Lab-AI/e5-mistral-7b-instruct benötigt 32 GB RAM. :lol: |
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:03 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz