-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
repair pointer events and add zoom and drag and drop in editor
- Loading branch information
Stefan Werner
committed
Dec 11, 2023
1 parent
63e3940
commit a6e1a94
Showing
19 changed files
with
549 additions
and
161 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from langchain.vectorstores import Chroma | ||
|
||
vectordb = Chroma.from_documents(data, embeddings, ids) | ||
|
||
from chromaviz import visualize_collection | ||
visualize_collection(vectordb._collection) | ||
|
||
visualize_collection(vectordb._collection) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from pprint import pprint | ||
|
||
import spacy | ||
|
||
# Load the spaCy model | ||
nlp = spacy.load("en_core_web_sm") | ||
|
||
def parse_sentences(text): | ||
# Use spaCy's pipeline for sentence segmentation | ||
doc = nlp(text) | ||
sentences = [sent.text.strip() for sent in doc.sents] | ||
return sentences | ||
|
||
def get_inputs(filename): | ||
with open(filename, 'r') as f: | ||
text = f.read() | ||
return parse_sentences(text) | ||
|
||
if __name__ == "__main__": | ||
dialogue_text = """ | ||
My dear Phaedrus, whence come you, and whither are you going? | ||
I come from Lysias the son of Cephalus, and I am going to | ||
take a walk outside the wall, | ||
for I have been sitting with him the | ||
whole morning; and our common friend Acumenus tells me that it is | ||
much more refreshing to walk in the open air than to be shut up in | ||
a cloister. | ||
There he is right. Lysias then, I suppose, was in the town? | ||
""" | ||
|
||
parsed_dialogue = parse_sentences(dialogue_text) | ||
pprint(parsed_dialogue) | ||
|
||
# Example of reading from a file | ||
# pprint(get_inputs("texts/phaedrus.1b.txt")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.