Giter Club home page Giter Club logo

Comments (6)

schraepf avatar schraepf commented on July 18, 2024 1

@vlad-tsoy - I'm creating my index with these fields:

fields = [
    SearchField(name="id", type=SearchFieldDataType.String, key=True, filterable=True, sortable=False, facetable=False, analyzer_name="keyword"),
    #SearchField(name="user", type=SearchFieldDataType.String, sortable=False, filterable=True, facetable=False), #used for filtering
    #SearchField(name="chatThreadId", type=SearchFieldDataType.String, sortable=False, filterable=True, facetable=False), #used for filtering
    SearchField(name="pageContent", type=SearchFieldDataType.String, sortable=False, filterable=False, facetable=False),
    SearchField(name="metadata", type=SearchFieldDataType.String, sortable=False, filterable=False, facetable=False),
    SearchField(name="embedding", type=SearchFieldDataType.Collection(SearchFieldDataType.Single), vector_search_dimensions=1536, vector_search_profile_name="myHnswProfile"),
    SearchField(name="parent_id", type=SearchFieldDataType.String, sortable=True, filterable=True, facetable=True)
]

And configured my skillset output mappings to match:

          mappings=[  
               InputFieldMappingEntry(name="pageContent", source="/document/pages/*"),  
               InputFieldMappingEntry(name="embedding", source="/document/pages/*/vector"),  
               InputFieldMappingEntry(name="metadata", source="/document/metadata_storage_name")  
           ],  

from azurechat.

tvonment avatar tvonment commented on July 18, 2024

i had the same problem and solved it with a quick fix. but i think someone should have a closer look at it.
the problem is, that my search had the content in a different field as pageContent so my content got lost in the FormatCitations Function.

when i update the FormatCitations Function it works for me:
(citation-service.ts)

export const FormatCitations = (citation: any[]) => {
  const withoutEmbedding: DocumentSearchResponse[] = [];
  citation.forEach((d) => {
    withoutEmbedding.push({
      score: d.score,
      document: {
        metadata: d.document.metadata,
        pageContent: d.document.pageContent || d.document.content || d.document.chunk,
        chatThreadId: d.document.chatThreadId,
        id: "",
        user: "",
      },
    });
  });

  return withoutEmbedding;
};

pageContent: d.document.pageContent || d.document.content || d.document.chunk
this should include your possible fields with the content.

or just make sure that the content in your Azure Search is in the Field pageContent.

from azurechat.

schraepf avatar schraepf commented on July 18, 2024

I'm having the same issue trying to connect to the index I've created using integrated vectorization. The wizard and python examples create the same index format, and when I connect the extension I get exactly the results in OP's screenshot.

I'm looking for an approach to use integrated vectorization via Indexer Skillsets to maintain indexes for this solution.

from azurechat.

schraepf avatar schraepf commented on July 18, 2024

Solved - modified the index and the output mappings of my skillset

from azurechat.

vlad-tsoy avatar vlad-tsoy commented on July 18, 2024

Solved - modified the index and the output mappings of my skillset

I'm also trying to use integrated vectorization, how did you modify the index?

from azurechat.

vlad-tsoy avatar vlad-tsoy commented on July 18, 2024

@vlad-tsoy - I'm creating my index with these fields:

fields = [
    SearchField(name="id", type=SearchFieldDataType.String, key=True, filterable=True, sortable=False, facetable=False, analyzer_name="keyword"),
    #SearchField(name="user", type=SearchFieldDataType.String, sortable=False, filterable=True, facetable=False), #used for filtering
    #SearchField(name="chatThreadId", type=SearchFieldDataType.String, sortable=False, filterable=True, facetable=False), #used for filtering
    SearchField(name="pageContent", type=SearchFieldDataType.String, sortable=False, filterable=False, facetable=False),
    SearchField(name="metadata", type=SearchFieldDataType.String, sortable=False, filterable=False, facetable=False),
    SearchField(name="embedding", type=SearchFieldDataType.Collection(SearchFieldDataType.Single), vector_search_dimensions=1536, vector_search_profile_name="myHnswProfile"),
    SearchField(name="parent_id", type=SearchFieldDataType.String, sortable=True, filterable=True, facetable=True)
]

And configured my skillset output mappings to match:

          mappings=[  
               InputFieldMappingEntry(name="pageContent", source="/document/pages/*"),  
               InputFieldMappingEntry(name="embedding", source="/document/pages/*/vector"),  
               InputFieldMappingEntry(name="metadata", source="/document/metadata_storage_name")  
           ],  

Thank you, Michael!

from azurechat.

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.