Comments (10)
It's a precautionary check since we don't want people to accidentally overwrite their previously built trees. You should enter 'n' and it'll continue building the tree.
from raptor.
Also, to quickly build the leaf layer and a single dummy layer on top without building the entire actual RAPTOR tree, you can do the following.
from raptor import RetrievalAugmentation, RetrievalAugmentationConfig, BaseSummarizationModel, BaseEmbeddingModel
import numpy as np
# test summarization model
class TestSummarizationModel(BaseSummarizationModel):
def __init__(self):
pass
def summarize(self, context, max_tokens=150):
return "This is a summary"
# test embedding model
class TestEmbeddingModel(BaseEmbeddingModel):
def __init__(self):
pass
def create_embedding(self, text):
return np.asarray([3, 1, 4, 1, 5, 9])
RAC = RetrievalAugmentationConfig(tb_num_layers=1, summarization_model=TestSummarizationModel(), embedding_model=TestEmbeddingModel())
RA = RetrievalAugmentation(config=RAC)
RA.add_documents(text)
from raptor.
Hey! I think this might be due to an issue with the text splitting while creating the leaf nodes.
Can you look at the leaf nodes by doing the following and checking if you have a lot of chunks with just dots in them.
for key, node in RA.tree.leaf_nodes.items():
print(key, node.text[:50])
from raptor.
@parthsarthi03 Alright, thanks. I will try that when it finishes. I have a lot of chunks.
BTW, I got this prompt... I left the script running but it halted on this prompted and waiting for the answer... it's not very practical.. should I open an issue for this ?
from raptor.
Hey! I think this might be due to an issue with the text splitting while creating the leaf nodes. Can you look at the leaf nodes by doing the following and checking if you have a lot of chunks with just dots in them.
for key, node in RA.tree.leaf_nodes.items(): print(key, node.text[:50])
I ran this now as it finished:
for key, node in RA.tree.leaf_nodes.items():
if node.text == ".":
print(node.text)
and the output is as below (there are more lines like this but I don't want to copy/paste everything here:
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
from raptor.
Yes, there might be an issue with the text splitting then, can you please provide me with a sample of the text document you are using, and I'll try to reproduce the issue.
from raptor.
@parthsarthi03 here you go https://gist.githubusercontent.com/younes-io/d471f38313c10a3f766787d87e3b3f85/raw/50ff6d90ba8ca0ba9b1d8a359529f74332e51a13/text_raptor.txt
from raptor.
This should be now solved with c703446.
from raptor.
Thank you @parthsarthi03
I'll be testing this
from raptor.
Closing this issue for now. If you have any further questions or encounter additional issues, please feel free to reopen it.
from raptor.
Related Issues (20)
- NarrativeQA metrics
- TypeError: Cannot use scipy.linalg.eigh for sparse A with k >= N. Use scipy.linalg.eigh(A.toarray()) or reduce k. HOT 4
- Question about experiment HOT 3
- When the text gets longer, the embedding API does not seem to work. HOT 5
- Missing implied functionality `add to existing` HOT 3
- Support for Azure OpenAi HOT 2
- Return Citation HOT 2
- Constructing Layer Issue HOT 3
- Is it not possible to use in AZURE? HOT 1
- Adding new Document to the existing RAPTOR setup
- num_layers acts like max_num_layers HOT 2
- UMAP n_neighbors must be greater than 1 HOT 11
- Inquiring about Vector DB implementation HOT 2
- multi doc HOT 2
- There seems to be a bug in the demo code.
- Evaluation code HOT 1
- Support for seeing Created Tree ? HOT 4
- **Outdated Dependencies in requirements.txt Causing Conflicts** HOT 1
- Bug in chunk splitting HOT 1
- TypeError: expected string or buffer HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raptor.