Rechercher

Article
· Nov 11, 2024 3m de lecture

EduVerse: Accessible Learning Assistant

🌍 Inclusion & Innovation in Education 🌍
Our project reimagines learning for all students, with a focus on accessibility and interactive experiences. Built with the goal of making education engaging and inclusive, the tool is designed to support students of all abilities in learning complex material in an intuitive way.

💡 What It Does
This educational app transforms lesson presentations into interactive study sessions:

  • Transform Presentations: With Optical Character Recognition (OCR) technology, the app scans and converts presentation slides into digital text and vector data, creating accessible content from standard slideshows.
  • AI Conversations: Our app brings presentations to life with an AI chat assistant, allowing users to ask questions about any topic covered in the slides. The AI utilizes Natural Language Processing (NLP) and LangChain for intelligent, context-aware responses.
  • Retro-Style Quizzes: After each session, users can test their knowledge with auto-generated, retro-style quizzes that make learning fun and reinforce their understanding.

🔧 How It’s Built
We combined powerful technologies to create a responsive and accessible app:

  • Frontend: Developed in Next.js for a responsive and user-friendly interface.
  • Data Storage: We use InterSystems IRIS Vector Database to store and efficiently retrieve vectorized presentation content.
  • AI & NLP: A Language Learning Model (LLM) is integrated with LangChain, making conversations meaningful by referencing both user input and the vectorized presentation data.
  • Backend: FastAPI backend for secure, scalable performance.
  • Quiz Generation: NLP algorithms create dynamic, interactive quizzes that personalize learning with every session.

This tool represents a step forward in making education inclusive, engaging, and accessible for everyone.

Integrating InterSystems IRIS Vector Search: A Practical Guide

InterSystems IRIS Vector Search is a powerful tool for developers building applications with advanced vector search capabilities. By leveraging IRIS Vector Search with FastAPI, we can create a robust document processing and querying system. This article will walk you through integrating IRIS Vector Search into a FastAPI project and setting it up on your local machine, highlighting key features for intelligent document analysis.

Setting Up IRIS Locally

  1. Clone the Repository:

git clone https://github.com/intersystems-community/iris-vector-search.git

  1. Start the Docker containers (one for IRIS, one for Jupyter):

docker-compose up

 

Integration with FastAPI

Our project uses IRIS Vector Search to handle document processing and similarity-based queries, allowing for efficient storage and search across large volumes of text data. Here's how we integrated IRIS Vector Search into FastAPI.

Step 1: Initialization

First, install the required package:

pip install langchain-iris

Now we initialize our vector store using the IRISVector class from the langchain_iris module:

from langchain_iris import IRISVector

vector_store = IRISVector.from_documents(

    embedding=embeddings,

    documents=docs,

    collection_name=COLLECTION_NAME,

    connection_string=IRIS_CONNECTION_STRING

)

This code snippet creates a vector store from the provided documents using embeddings, storing the results in IRIS for fast and efficient querying.

 

Step 2: Document Processing

When a user uploads a PDF, the application processes the document by extracting text and splitting it into chunks. These chunks are then added to the IRIS vector store:

docs = text_splitter.split_documents(docs)

initialize_vector_store(docs)

By breaking down each document into smaller segments, we ensure that each chunk is indexed and stored, improving the accuracy of similarity-based searches.

 

Step 3: Querying Documents

Once our documents are processed and stored, we can use the vector store for similarity searches:

docs_with_score = vector_store.similarity_search_with_score(query, k=3)

This command returns the top three most relevant documents based on the query, each with an associated relevance score.

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer
Article
· Nov 10, 2024 3m de lecture

第十七章 TCP 客户端 服务器通信 - 使用OPEN命令

第十七章 TCP 客户端 服务器通信 - 使用OPEN命令

使用OPEN命令

OPEN命令保留一个TCP绑定设备供使用。其语法为:

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer
Article
· Nov 10, 2024 2m de lecture

Java External Language Gateway

If you like Java and have a thriving Java ecosystem at work into which you need to incorporate IRIS, it's not a problem. Java External Language Gateway will do it seamlessly, almost. This gateway serves as a bridge between Java and Object Script in IRIS. You can create objects of Java classes in IRIS and call their methods. You just need a jar file to do this.

Connection diagram: proxy object <-> Gateway object <-> TCP/IP <-> External server <-> target object

The first thing you need to do is set up the environment. To start using the Java Gateway, ensure you have the following:

  1. InterSystems IRIS: Installed and running.
  2. Java Development Kit (JDK): Installed and configured.

The second requirement may sound simple, since you're already using Java in your work, but it isn't. Thanks to this question, it turned out that you need to use JDK version 11 at the most. Which means that you need to change the version in your IDE which may case quite a bit of trouble.

Next step, we can check that everything works and try to instantiate the object of a Java system class. To do this, you have to start a connection, creat a proxy object, and call a method. Sounds like a lot of code, but in reality it's just one statement:

write $system.external.getJavaGateway().new("java.util.Date").toString()

This will print the current date and time on screen.

To go further, we can create our own Java class:


public class Dish {
	private String name;
	private String description;
	private String category;
	private Float price;
	private String currency;
	private Integer calories;
	
	public void setName(String name) {
		this.name = name;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public void setPrice(Float price) {
		this.price = price;
	}

	public void setCurrency(String currency) {
		this.currency = currency;
	}

	public void setCalories(Integer calories) {
		this.calories = calories;
	}
	
	public String describe() {
		return "The dish "+this.name+" costs "+this.price.toString()+
				this.currency+" and contains "+this.calories+" calories!";
	}
}

and call it's methods from Object Script:

 set javaGate = $SYSTEM.external.getJavaGateway()
 do javaGate.addToPath("D:\Temp\GatewayTest.jar")
 set dish = javaGate.new("Dish")
 do dish.setCalories(1000)
 do dish.setCategory("salad")
 do dish.setCurrency("GBP")
 do dish.setDescription("Very tasty greek salad")
 do dish.setName("Greek salad")
 do dish.setPrice(15.2)
 write dish.describe()

As a result we will get a string with the description of the created dish:

The dish Greek salad costs 15.2GBP and contains 1000 calories!

Quite neat, don't you think?

Anyway, learn more about using Gateways from the Documentation and good luck implementing this knowledge in your projects!

Discussion (0)1
Connectez-vous ou inscrivez-vous pour continuer