Giter VIP home page Giter VIP logo

Comments (10)

parthsarthi03 avatar parthsarthi03 commented on June 4, 2024 1

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.

parthsarthi03 avatar parthsarthi03 commented on June 4, 2024 1

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.

parthsarthi03 avatar parthsarthi03 commented on June 4, 2024

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.

younes-io avatar younes-io commented on June 4, 2024

@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 ?

image

from raptor.

younes-io avatar younes-io commented on June 4, 2024

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.

parthsarthi03 avatar parthsarthi03 commented on June 4, 2024

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.

younes-io avatar younes-io commented on June 4, 2024

@parthsarthi03 here you go https://gist.githubusercontent.com/younes-io/d471f38313c10a3f766787d87e3b3f85/raw/50ff6d90ba8ca0ba9b1d8a359529f74332e51a13/text_raptor.txt

from raptor.

parthsarthi03 avatar parthsarthi03 commented on June 4, 2024

This should be now solved with c703446.

from raptor.

younes-io avatar younes-io commented on June 4, 2024

Thank you @parthsarthi03
I'll be testing this

from raptor.

parthsarthi03 avatar parthsarthi03 commented on June 4, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.