Coder Social home page Coder Social logo

johnsirmon / clearcouncil Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 73 KB

ClearCouncil: Automated tools for collecting, organizing, and embedding publicly available local state county council documents (minutes, agendas) into LLMs. Python, JS, and wget scripts included for easy data retrieval and integration.

Batchfile 2.94% Python 81.38% Shell 15.68%
civic-tech data-retrieval document-processing gpt langchain langchain-python local-government open-data openai retrieval-augmented-generation transparency-enhancing-technologies wget

clearcouncil's People

Contributors

johnsirmon avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

mustafaelms

clearcouncil's Issues

env issue with openai key

fix this pesky api key issue with my .env file (had to hardcode to get to work as a test and removed of course)

fix FAISS embedding code as it is failing with "FAISS.__init__() missing 4 required positional arguments"

fix bug
line 21, in
faiss_store = FAISS()
^^^^^^^
TypeError: FAISS.init() missing 4 required positional arguments: 'embedding_function', 'index', 'docstore', and 'index_to_docstore_id'

I think I need to modify as follows
from langchain.vectorstores import FAISS

Example: Define embedding_function (modify this based on your actual embedding method)

def embedding_function(text):
return embeddings.encode(text)

Example: Initialize a FAISS index

FAISS index can be initialized in various ways depending on the type of data and required precision

import faiss
index = faiss.IndexFlatL2(768) # Example for a 768-dimensional L2 index, adjust dimensions as needed

Example: Define docstore and index_to_docstore_id (simplified for illustration)

You'll need to implement these according to your data structure

docstore = {} # Can be a dictionary, database, etc.
def index_to_docstore_id(index_id):
return docstore.get(index_id, None)

Initialize FAISS with the required arguments

faiss_store = FAISS(embedding_function, index, docstore, index_to_docstore_id)

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.