mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-18 20:27:58 +00:00
updated
This commit is contained in:
parent
58a0c986c3
commit
4ca65ea545
@ -158,6 +158,7 @@ class TextVectorizer:
|
||||
|
||||
# Generate a list of colors for each data point based on the document path
|
||||
point_colors = [document_path_colors["_".join(path.split("_")[:-1])] for path in ref]
|
||||
|
||||
|
||||
# Create a scatter plot using Seaborn
|
||||
sns.scatterplot(x=embeddings_2d[:, 0], y=embeddings_2d[:, 1], hue=point_colors) # Plot document embeddings
|
||||
@ -217,10 +218,10 @@ class TextVectorizer:
|
||||
|
||||
# Connect the click event handler to the figure
|
||||
plt.gcf().canvas.mpl_connect("button_press_event", on_click)
|
||||
if save_fig_path:
|
||||
plt.savefig(save_fig_path)
|
||||
if show_interactive_form:
|
||||
plt.show()
|
||||
if save_fig_path:
|
||||
plt.savefig(save_fig_path)
|
||||
|
||||
def add_document(self, document_id, text, chunk_size, overlap_size, force_vectorize=False):
|
||||
if document_id in self.embeddings and not force_vectorize:
|
||||
|
Loading…
Reference in New Issue
Block a user