sourceName stringclasses 1 value | url stringclasses 20 values | action stringclasses 1 value | body stringlengths 23 1.11k | format stringclasses 1 value | metadata dict | title stringclasses 20 values | updated stringclasses 1 value | embedding sequencelengths 384 384 |
|---|---|---|---|---|---|---|---|---|
devcenter | https://www.mongodb.com/developer/products/atlas/atlas-search-cene-1 | created | # The Atlas Search 'cene: Season 1
# The Atlas Search 'cene: Season 1
Welcome to the first season of a video series dedicated to Atlas Search! This series of videos is designed to guide you through the journey from getting started and understanding the concepts, to advanced techniques.
## What is Atlas Search?
[Atlas Search][1] is an embedded full-text search in MongoDB Atlas that gives you a seamless, scalable experience for building relevance-based app features. Built on Apache Lucene, Atlas Search eliminates the need to run a separate search system alongside your database.
By integrating the database, search engine, and sync mechanism into a single, unified, and fully managed platform, Atlas Search is the fastest and easiest way to build relevance-based search capabilities directly into applications. | md | {
"tags": [
"Atlas"
],
"pageDescription": "The Atlas Search 'cene: Season 1",
"contentType": "Video"
} | The Atlas Search 'cene: Season 1 | 2024-05-20T17:32:23.500Z | [
-0.04333272948861122,
0.008474143221974373,
0.02093709260225296,
-0.013369143009185791,
0.021301070228219032,
0.00247253873385489,
0.021123070269823074,
0.01927790604531765,
0.024801388382911682,
-0.014641942456364632,
0.008706260472536087,
-0.01648327149450779,
0.04427856579422951,
0.0068... |
devcenter | https://www.mongodb.com/developer/products/atlas/atlas-search-cene-1 | created | > Hip to the *'cene*
>
> The name of this video series comes from a contraction of "Lucene",
> the search engine library leveraged by Atlas. Or it's a short form of "scene".
## Episode Guide
### **[Episode 1: What is Atlas Search & Quick Start][2]**
In this first episode of the Atlas Search 'cene, learn what Atlas Search is, and get a quick start introduction to setting up Atlas Search on your data. Within a few clicks, you can set up a powerful, full-text search index on your Atlas collection data, and leverage the fast, relevant results to your users queries.
### **[Episode 2: Configuration / Development Environment][3]**
In order to best leverage Atlas Search, configuring it for your querying needs leads to success. In this episode, learn how Atlas Search maps your documents to its index, and discover the configuration control you have. | md | {
"tags": [
"Atlas"
],
"pageDescription": "The Atlas Search 'cene: Season 1",
"contentType": "Video"
} | The Atlas Search 'cene: Season 1 | 2024-05-20T17:32:23.500Z | [
-0.05399884656071663,
-0.0029614008963108063,
0.018389998003840446,
-0.02181326411664486,
0.02867722511291504,
0.01909821666777134,
0.014562747441232204,
0.025323189795017242,
0.004523050971329212,
-0.0012164791114628315,
0.0032280415762215853,
-0.015654992312192917,
0.02656267024576664,
0... |
devcenter | https://www.mongodb.com/developer/products/atlas/atlas-search-cene-1 | created | ### **[Episode 3: Indexing][4]**
While Atlas Search automatically indexes your collections content, it does demand attention to the indexing configuration details in order to match users queries appropriately. This episode covers how Atlas Search builds an inverted index, and the options one must consider.
### **[Episode 4: Searching][5]**
Atlas Search provides a rich set of query operators and relevancy controls. This episode covers the common query operators, their relevancy controls, and ends with coverage of the must-have Query Analytics feature.
### **[Episode 5: Faceting][6]**
Facets produce additional context for search results, providing a list of subsets and counts within. This episode details the faceting options available in Atlas Search.
### **[Episode 6: Advanced Search Topics][7]**
In this episode, we go through some more advanced search topics including embedded documents, fuzzy search, autocomplete, highlighting, and geospatial. | md | {
"tags": [
"Atlas"
],
"pageDescription": "The Atlas Search 'cene: Season 1",
"contentType": "Video"
} | The Atlas Search 'cene: Season 1 | 2024-05-20T17:32:23.500Z | [
-0.051897041499614716,
-0.005160131957381964,
0.02444884181022644,
0.020137501880526543,
0.04741182178258896,
0.007022537756711245,
0.025010867044329643,
0.010959460400044918,
-0.02913862094283104,
-0.0008940236293710768,
0.025229420512914658,
-0.026444939896464348,
-0.004209971986711025,
... |
devcenter | https://www.mongodb.com/developer/products/atlas/atlas-search-cene-1 | created | In this episode, we go through some more advanced search topics including embedded documents, fuzzy search, autocomplete, highlighting, and geospatial.
### **[Episode 7: Query Analytics][8]**
Are your users finding what they are looking for? Are your top queries returning the best results? This episode covers the important topic of query analytics. If you're using search, you need this!
### **[Episode 8: Tips & Tricks][9]**
In this final episode of The Atlas Search 'cene Season 1, useful techniques to introspect query details and see the relevancy scoring computation details. Also shown is how to get facets and search results back in one API call. | md | {
"tags": [
"Atlas"
],
"pageDescription": "The Atlas Search 'cene: Season 1",
"contentType": "Video"
} | The Atlas Search 'cene: Season 1 | 2024-05-20T17:32:23.500Z | [
-0.06676021963357925,
-0.004111364483833313,
0.004736207891255617,
-0.013263901695609093,
0.030556093901395798,
0.01958758383989334,
0.03644321858882904,
0.0224448349326849,
0.006258488167077303,
-0.0028273065108805895,
-0.005389469675719738,
-0.024699581786990166,
0.014987430535256863,
0.... |
devcenter | https://www.mongodb.com/developer/products/atlas/atlas-search-cene-1 | created | [1]: https://www.mongodb.com/atlas/search
[2]: https://www.mongodb.com/developer/videos/what-is-atlas-search-quick-start/
[3]: https://www.mongodb.com/developer/videos/atlas-search-configuration-development-environment/
[4]: https://www.mongodb.com/developer/videos/mastering-indexing-for-perfect-query-matches/
[5]: https://www.mongodb.com/developer/videos/query-operators-relevancy-controls-for-precision-searches/
[6]: https://www.mongodb.com/developer/videos/faceting-mastery-unlock-the-full-potential-of-atlas-search-s-contextual-insights/
[7]: https://www.mongodb.com/developer/videos/atlas-search-mastery-elevate-your-search-with-fuzzy-geospatial-highlighting-hacks/
[8]: https://www.mongodb.com/developer/videos/atlas-search-query-analytics/ | md | {
"tags": [
"Atlas"
],
"pageDescription": "The Atlas Search 'cene: Season 1",
"contentType": "Video"
} | The Atlas Search 'cene: Season 1 | 2024-05-20T17:32:23.500Z | [
-0.0772363692522049,
-0.016209488734602928,
0.023629581555724144,
0.005377569235861301,
0.05635572597384453,
-0.006048074923455715,
0.0033894714433699846,
-0.0009399149566888809,
-0.010975291021168232,
-0.015849722549319267,
0.010561182163655758,
-0.057873550802469254,
-0.006855860818177462,... |
devcenter | https://www.mongodb.com/developer/products/atlas/atlas-search-cene-1 | created | [8]: https://www.mongodb.com/developer/videos/atlas-search-query-analytics/
[9]: https://www.mongodb.com/developer/videos/tips-and-tricks-the-atlas-search-cene-season-1-episode-8/ | md | {
"tags": [
"Atlas"
],
"pageDescription": "The Atlas Search 'cene: Season 1",
"contentType": "Video"
} | The Atlas Search 'cene: Season 1 | 2024-05-20T17:32:23.500Z | [
-0.06959200650453568,
-0.017777325585484505,
0.003730013268068433,
-0.018731290474534035,
0.05623701959848404,
0.010634814389050007,
0.007514973636716604,
0.02913835644721985,
0.00411106925457716,
-0.008122571744024754,
0.008557385765016079,
-0.049779560416936874,
0.01478045154362917,
0.02... |
devcenter | https://www.mongodb.com/developer/products/mongodb/atlas-open-ai-review-summary | created | # Using MongoDB Atlas Triggers to Summarize Airbnb Reviews with OpenAI
In the realm of property rentals, reviews play a pivotal role. MongoDB Atlas triggers, combined with the power of OpenAI's models, can help summarize and analyze these reviews in real-time. In this article, we'll explore how to utilize MongoDB Atlas triggers to process Airbnb reviews, yielding concise summaries and relevant tags.
This article is an additional feature added to the hotels and apartment sentiment search application developed in Leveraging OpenAI and MongoDB Atlas for Improved Search Functionality.
## Introduction
MongoDB Atlas triggers allow users to define functions that execute in real-time in response to database operations. These triggers can be harnessed to enhance data processing and analysis capabilities. In this example, we aim to generate summarized reviews and tags for a sample Airbnb dataset.
Our original data model has each review embedded in the listing document as an array: | md | {
"tags": [
"MongoDB",
"JavaScript",
"AI",
"Node.js"
],
"pageDescription": "Uncover the synergy of MongoDB Atlas triggers and OpenAI models in real-time analysis and summarization of Airbnb reviews. ",
"contentType": "Tutorial"
} | Using MongoDB Atlas Triggers to Summarize Airbnb Reviews with OpenAI | 2024-05-20T17:32:23.500Z | [
-0.02477567084133625,
-0.004139764234423637,
0.0033128077629953623,
0.009702196344733238,
0.046617407351732254,
0.02175799570977688,
0.023161737248301506,
0.03339182958006859,
0.003896396839991212,
-0.019296376034617424,
-0.010015616193413734,
-0.00755298463627696,
0.02327808551490307,
0.0... |
devcenter | https://www.mongodb.com/developer/products/mongodb/atlas-open-ai-review-summary | created | ```javascript
"reviews": { "_id": "2663437",
"date": { "$date": "2012-10-20T04:00:00.000Z" }, \
"listing_id": "664017",
"reviewer_id": "633940",
"reviewer_name": "Patricia",
"comments": "I booked the room at Marinete's apartment for my husband. He was staying in Rio for a week because he was studying Portuguese. He loved the place. Marinete was very helpfull, the room was nice and clean. \r\nThe location is perfect. He loved the time there. \r\n\r\n" },
{ "_id": "2741592",
"date": { "$date": "2012-10-28T04:00:00.000Z" },
"listing_id": "664017", | md | {
"tags": [
"MongoDB",
"JavaScript",
"AI",
"Node.js"
],
"pageDescription": "Uncover the synergy of MongoDB Atlas triggers and OpenAI models in real-time analysis and summarization of Airbnb reviews. ",
"contentType": "Tutorial"
} | Using MongoDB Atlas Triggers to Summarize Airbnb Reviews with OpenAI | 2024-05-20T17:32:23.500Z | [
-0.047046247869729996,
0.013360108248889446,
0.03314833715558052,
-0.026793386787176132,
0.01846095733344555,
-0.014731922186911106,
0.038464728742837906,
0.050045598298311234,
0.0033412629272788763,
-0.008582023903727531,
-0.004438611213117838,
-0.01506042666733265,
-0.01605268009006977,
... |
devcenter | https://www.mongodb.com/developer/products/mongodb/atlas-open-ai-review-summary | created | "listing_id": "664017",
"reviewer_id": "3932440",
"reviewer_name": "Carolina",
"comments": "Es una muy buena anfitriona, preocupada de que te encuentres cómoda y te sugiere que actividades puedes realizar. Disfruté mucho la estancia durante esos días, el sector es central y seguro." }, ... ]
``` | md | {
"tags": [
"MongoDB",
"JavaScript",
"AI",
"Node.js"
],
"pageDescription": "Uncover the synergy of MongoDB Atlas triggers and OpenAI models in real-time analysis and summarization of Airbnb reviews. ",
"contentType": "Tutorial"
} | Using MongoDB Atlas Triggers to Summarize Airbnb Reviews with OpenAI | 2024-05-20T17:32:23.500Z | [
-0.030334945768117905,
-0.009156111627817154,
0.06746015697717667,
0.008061906322836876,
-0.0019449418177828193,
0.013199279084801674,
0.02676151879131794,
0.06135082244873047,
-0.023230483755469322,
0.005505756940692663,
-0.012951171956956387,
-0.058555614203214645,
0.013168364763259888,
... |
devcenter | https://www.mongodb.com/developer/products/mongodb/atlas-open-ai-review-summary | created | ## Prerequisites
- App Services application (e.g., application-0). Ensure linkage to the cluster with the Airbnb data.
- OpenAI account with API access.
![Open AI Key
### Secrets and Values
1. Navigate to your App Services application.
2. Under "Values," create a secret named `openAIKey` with your OPEN AI API key.
3. Create a linked value named OpenAIKey and link to the secret.
## The trigger code
The provided trigger listens for changes in the sample_airbnb.listingsAndReviews collection. Upon detecting a new review, it samples up to 50 reviews, sends them to OpenAI's API for summarization, and updates the original document with the summarized content and tags.
Please notice that the trigger reacts to updates that were marked with `"process" : false` flag. This field indicates that there were no summary created for this batch of reviews yet. | md | {
"tags": [
"MongoDB",
"JavaScript",
"AI",
"Node.js"
],
"pageDescription": "Uncover the synergy of MongoDB Atlas triggers and OpenAI models in real-time analysis and summarization of Airbnb reviews. ",
"contentType": "Tutorial"
} | Using MongoDB Atlas Triggers to Summarize Airbnb Reviews with OpenAI | 2024-05-20T17:32:23.500Z | [
-0.01802649348974228,
-0.03896863013505936,
-0.004243589472025633,
-0.03542868047952652,
0.025339286774396896,
0.05924767628312111,
0.02433825097978115,
0.028019333258271217,
0.011712748557329178,
-0.0223247017711401,
-0.011218799278140068,
-0.0760888084769249,
0.009846837259829044,
0.0867... |
devcenter | https://www.mongodb.com/developer/products/mongodb/atlas-open-ai-review-summary | created | Example of a review update operation that will fire this trigger:
```javascript
listingsAndReviews.updateOne({"_id" : "1129303"}, { $push : { "reviews" : new_review } , $set : { "process" : false" }});
```
### Sample reviews function
To prevent overloading the API with a large number of reviews, a function sampleReviews is defined to randomly sample up to 50 reviews:
```javscript
function sampleReviews(reviews) {
if (reviews.length <= 50) {
return reviews;
}
const sampledReviews = ];
const seenIndices = new Set();
while (sampledReviews.length < 50) {
const randomIndex = Math.floor(Math.random() * reviews.length);
if (!seenIndices.has(randomIndex)) {
seenIndices.add(randomIndex);
sampledReviews.push(reviews[randomIndex]);
}
}
return sampledReviews;
}
``` | md | {
"tags": [
"MongoDB",
"JavaScript",
"AI",
"Node.js"
],
"pageDescription": "Uncover the synergy of MongoDB Atlas triggers and OpenAI models in real-time analysis and summarization of Airbnb reviews. ",
"contentType": "Tutorial"
} | Using MongoDB Atlas Triggers to Summarize Airbnb Reviews with OpenAI | 2024-05-20T17:32:23.500Z | [
-0.09217647463083267,
-0.021917041391134262,
0.02973153442144394,
-0.03574100881814957,
0.0037330961786210537,
0.045699745416641235,
0.02375026047229767,
0.04615376517176628,
0.03743452578783035,
-0.02945530228316784,
-0.020444029942154884,
0.004793725907802582,
-0.00028507609385997057,
0.... |
devcenter | https://www.mongodb.com/developer/products/mongodb/atlas-open-ai-review-summary | created | return sampledReviews;
}
```
### Main trigger logic
The main trigger logic is invoked when an update change event is detected with a `"process" : false` field.
```javascript
exports = async function(changeEvent) {
// A Database Trigger will always call a function with a changeEvent.
// Documentation on ChangeEvents: https://www.mongodb.com/docs/manual/reference/change-events
// This sample function will listen for events and replicate them to a collection in a different Database
function sampleReviews(reviews) {
// Logic above...
if (reviews.length <= 50) {
return reviews;
}
const sampledReviews = [];
const seenIndices = new Set();
while (sampledReviews.length < 50) {
const randomIndex = Math.floor(Math.random() * reviews.length);
if (!seenIndices.has(randomIndex)) {
seenIndices.add(randomIndex);
sampledReviews.push(reviews[randomIndex]);
}
} | md | {
"tags": [
"MongoDB",
"JavaScript",
"AI",
"Node.js"
],
"pageDescription": "Uncover the synergy of MongoDB Atlas triggers and OpenAI models in real-time analysis and summarization of Airbnb reviews. ",
"contentType": "Tutorial"
} | Using MongoDB Atlas Triggers to Summarize Airbnb Reviews with OpenAI | 2024-05-20T17:32:23.500Z | [
-0.07496263831853867,
-0.0022931282874196768,
0.015449314378201962,
-0.032833877950906754,
0.0274550449103117,
0.023118797689676285,
0.040175266563892365,
0.06100309640169144,
0.019930480048060417,
-0.014482250437140465,
-0.013135907240211964,
-0.04342693090438843,
0.0036264185328036547,
0... |
devcenter | https://www.mongodb.com/developer/products/mongodb/atlas-open-ai-review-summary | created | return sampledReviews;
}
// Access the _id of the changed document:
const docId = changeEvent.documentKey._id;
const doc= changeEvent.fullDocument;
// Get the MongoDB service you want to use (see "Linked Data Sources" tab)
const serviceName = "mongodb-atlas";
const databaseName = "sample_airbnb";
const collection = context.services.get(serviceName).db(databaseName).collection(changeEvent.ns.coll);
// This function is the endpoint's request handler.
// URL to make the request to the OpenAI API.
const url = 'https://api.openai.com/v1/chat/completions';
// Fetch the OpenAI key stored in the context values.
const openai_key = context.values.get("openAIKey"); | md | {
"tags": [
"MongoDB",
"JavaScript",
"AI",
"Node.js"
],
"pageDescription": "Uncover the synergy of MongoDB Atlas triggers and OpenAI models in real-time analysis and summarization of Airbnb reviews. ",
"contentType": "Tutorial"
} | Using MongoDB Atlas Triggers to Summarize Airbnb Reviews with OpenAI | 2024-05-20T17:32:23.500Z | [
-0.031809691339731216,
-0.01273814681917429,
0.015823574736714363,
-0.00680987723171711,
0.050974052399396896,
0.03372253477573395,
0.02040598727762699,
0.06981812417507172,
-0.011519516818225384,
0.000307806592900306,
-0.02120952121913433,
-0.056947194039821625,
-0.012161685153841972,
0.0... |
devcenter | https://www.mongodb.com/developer/products/mongodb/atlas-open-ai-review-summary | created | // Fetch the OpenAI key stored in the context values.
const openai_key = context.values.get("openAIKey");
const reviews = doc.reviews.map((review) => {return {"comments" : review.comments}});
const sampledReviews= sampleReviews(reviews);
// Prepare the request string for the OpenAI API.
const reqString = `Summerize the reviews provided here: ${JSON.stringify(sampledReviews)} | instructions example:\n\n [{"comment" : "Very Good bed"} ,{"comment" : "Very bad smell"} ] \nOutput: {"overall_review": "Overall good beds and bad smell" , "neg_tags" : ["bad smell"], pos_tags : ["good bed"]}. No explanation. No 'Output:' string in response. Valid JSON. `;
console.log(`reqString: ${reqString}`); | md | {
"tags": [
"MongoDB",
"JavaScript",
"AI",
"Node.js"
],
"pageDescription": "Uncover the synergy of MongoDB Atlas triggers and OpenAI models in real-time analysis and summarization of Airbnb reviews. ",
"contentType": "Tutorial"
} | Using MongoDB Atlas Triggers to Summarize Airbnb Reviews with OpenAI | 2024-05-20T17:32:23.500Z | [
-0.035808634012937546,
0.0012021007714793086,
0.008661667816340923,
-0.05116145312786102,
0.04451536014676094,
-0.016249194741249084,
0.04040682688355446,
0.04493623226881027,
0.0037132801953703165,
-0.017337320372462273,
-0.04771295562386513,
-0.050985898822546005,
0.03205788880586624,
0.... |
devcenter | https://www.mongodb.com/developer/products/mongodb/atlas-open-ai-review-summary | created | // Call OpenAI API to get the response.
let resp = await context.http.post({
url: url,
headers: {
'Authorization': [`Bearer ${openai_key}`],
'Content-Type': ['application/json']
},
body: JSON.stringify({
model: "gpt-4",
temperature: 0,
messages: [
{
"role": "system",
"content": "Output json generator follow only provided example on the current reviews"
},
{
"role": "user",
"content": reqString
}
]
})
});
// Parse the JSON response
let responseData = JSON.parse(resp.body.text());
// Check the response status.
if(resp.statusCode === 200) {
console.log("Successfully received code.");
console.log(JSON.stringify(responseData)); | md | {
"tags": [
"MongoDB",
"JavaScript",
"AI",
"Node.js"
],
"pageDescription": "Uncover the synergy of MongoDB Atlas triggers and OpenAI models in real-time analysis and summarization of Airbnb reviews. ",
"contentType": "Tutorial"
} | Using MongoDB Atlas Triggers to Summarize Airbnb Reviews with OpenAI | 2024-05-20T17:32:23.500Z | [
-0.029451776295900345,
0.01280142180621624,
0.010928797535598278,
-0.06095277518033981,
0.03169967979192734,
0.0031140462961047888,
0.05159224569797516,
0.04979121312499046,
0.022862166166305542,
0.006799749564379454,
-0.01923985779285431,
-0.053314026445150375,
0.02966015599668026,
0.0834... |
devcenter | https://www.mongodb.com/developer/products/mongodb/atlas-open-ai-review-summary | created | const code = responseData.choices[0].message.content;
// Get the required data to be added into the document
const updateDoc = JSON.parse(code)
// Set a flag that this document does not need further re-processing
updateDoc.process = true
await collection.updateOne({_id : docId}, {$set : updateDoc});
} else {
console.error("Failed to generate filter JSON.");
console.log(JSON.stringify(responseData));
return {};
}
};
```
Key steps include: | md | {
"tags": [
"MongoDB",
"JavaScript",
"AI",
"Node.js"
],
"pageDescription": "Uncover the synergy of MongoDB Atlas triggers and OpenAI models in real-time analysis and summarization of Airbnb reviews. ",
"contentType": "Tutorial"
} | Using MongoDB Atlas Triggers to Summarize Airbnb Reviews with OpenAI | 2024-05-20T17:32:23.500Z | [
-0.08430814743041992,
0.01045955065637827,
0.03579709306359291,
-0.03414199873805046,
0.02627354860305786,
0.021485809236764908,
0.008494805544614792,
0.06600920855998993,
-0.008102654479444027,
0.003950087353587151,
-0.019482463598251343,
-0.013794470578432083,
0.023629071190953255,
0.022... |
devcenter | https://www.mongodb.com/developer/products/mongodb/atlas-open-ai-review-summary | created | Key steps include:
- API request preparation: Reviews from the changed document are sampled and prepared into a request string for the OpenAI API. The format and instructions are tailored to ensure the API returns a valid JSON with summarized content and tags.
- API interaction: Using the context.http.post method, the trigger sends the prepared data to the OpenAI API.
- Updating the original document: Upon a successful response from the API, the trigger updates the original document with the summarized content, negative tags (neg_tags), positive tags (pos_tags), and a process flag set to true. | md | {
"tags": [
"MongoDB",
"JavaScript",
"AI",
"Node.js"
],
"pageDescription": "Uncover the synergy of MongoDB Atlas triggers and OpenAI models in real-time analysis and summarization of Airbnb reviews. ",
"contentType": "Tutorial"
} | Using MongoDB Atlas Triggers to Summarize Airbnb Reviews with OpenAI | 2024-05-20T17:32:23.500Z | [
-0.06425446271896362,
0.015196016989648342,
0.014957580715417862,
-0.04905816540122032,
0.04558635503053665,
0.026605455204844475,
0.02458653226494789,
0.042485110461711884,
0.0024984688498079777,
0.00038978096563369036,
0.0014386388938874006,
-0.04643610119819641,
0.013037458062171936,
0.... |
devcenter | https://www.mongodb.com/developer/products/mongodb/atlas-open-ai-review-summary | created | Here is a sample result that is added to the processed listing document:
```
"process": true,
"overall_review": "Overall, guests had a positive experience at Marinete's apartment. They praised the location, cleanliness, and hospitality. However, some guests mentioned issues with the dog and language barrier.",
"neg_tags": [ "language barrier", "dog issues" ],
"pos_tags": [ "great location", "cleanliness", "hospitality" ]
```
Once the data is added to our documents, providing this information in our VUE application is as simple as adding this HTML template:
```html
Overall Review (ai based) : {{ listing.overall_review }}
{{tag}}
{{tag}}
``` | md | {
"tags": [
"MongoDB",
"JavaScript",
"AI",
"Node.js"
],
"pageDescription": "Uncover the synergy of MongoDB Atlas triggers and OpenAI models in real-time analysis and summarization of Airbnb reviews. ",
"contentType": "Tutorial"
} | Using MongoDB Atlas Triggers to Summarize Airbnb Reviews with OpenAI | 2024-05-20T17:32:23.500Z | [
-0.018523477017879486,
0.013775629922747612,
0.018246788531541824,
-0.037361256778240204,
0.060052309185266495,
0.015071781352162361,
0.022544700652360916,
0.05805240944027901,
0.02249765209853649,
0.003295812988653779,
-0.00004248873301548883,
-0.03664785996079445,
0.0252126082777977,
0.0... |
devcenter | https://www.mongodb.com/developer/products/mongodb/atlas-open-ai-review-summary | created | Overall Review (ai based) : {{ listing.overall_review }}
{{tag}}
{{tag}}
```
## Conclusion
By integrating MongoDB Atlas triggers with OpenAI's powerful models, we can efficiently process and analyze large volumes of reviews in real-time. This setup not only provides concise summaries of reviews but also categorizes them into positive and negative tags, offering valuable insights to property hosts and potential renters.
Questions? Comments? Let’s continue the conversation over in our [community forums. | md | {
"tags": [
"MongoDB",
"JavaScript",
"AI",
"Node.js"
],
"pageDescription": "Uncover the synergy of MongoDB Atlas triggers and OpenAI models in real-time analysis and summarization of Airbnb reviews. ",
"contentType": "Tutorial"
} | Using MongoDB Atlas Triggers to Summarize Airbnb Reviews with OpenAI | 2024-05-20T17:32:23.500Z | [
-0.04842721298336983,
-0.025147899985313416,
0.01631397195160389,
-0.019730543717741966,
0.03751155734062195,
0.006439289078116417,
0.031063158065080643,
0.06317470222711563,
-0.012957305647432804,
0.01124939601868391,
-0.008856471627950668,
-0.001972187776118517,
0.00006470937660196796,
0... |
devcenter | https://www.mongodb.com/developer/products/mongodb/getting-started-with-mongodb-and-codewhisperer | created | # Getting Started with MongoDB and AWS Codewhisperer
**Introduction**
----------------
Amazon CodeWhisperer is trained on billions of lines of code and can generate code suggestions — ranging from snippets to full functions — in real-time, based on your comments and existing code. AI code assistants have revolutionized developers’ coding experience, but what sets Amazon CodeWhisperer apart is that MongoDB has collaborated with the AWS Data Science team, enhancing its capabilities!
At MongoDB, we are always looking to enhance the developer experience, and we've fine-tuned the CodeWhisperer Foundational Models to deliver top-notch code suggestions — trained on, and tailored for, MongoDB. This gives developers of all levels the best possible experience when using CodeWhisperer for MongoDB functions. | md | {
"tags": [
"MongoDB",
"JavaScript",
"Java",
"Python",
"AWS",
"AI"
],
"pageDescription": "",
"contentType": "Tutorial"
} | Getting Started with MongoDB and AWS Codewhisperer | 2024-05-20T17:32:23.500Z | [
-0.06456639617681503,
-0.02141782082617283,
0.006294905208051205,
-0.021012524142861366,
0.04662040248513222,
-0.0047924211248755455,
-0.004582950379699469,
0.02320190891623497,
-0.01318175345659256,
0.016072852537035942,
0.006855227518826723,
-0.038180913776159286,
0.020347001031041145,
0... |
devcenter | https://www.mongodb.com/developer/products/mongodb/getting-started-with-mongodb-and-codewhisperer | created | This tutorial will help you get CodeWhisperer up and running in VS Code, but CodeWhisperer also works with a number of other IDEs, including IntelliJ IDEA, AWS Cloud9, AWS Lambda console, JupyterLab, and Amazon SageMaker Studio. On the [Amazon CodeWhisperer site][1], you can find tutorials that demonstrate how to set up CodeWhisperer on different IDEs, as well as other documentation.
*Note:* CodeWhisperer allows users to start without an AWS account because usually, creating an AWS account requires a credit card. Currently, CodeWhisperer is free for individual users. So it’s super easy to get up and running.
**Installing CodeWhisperer for VS Code**
CodeWhisperer doesn’t have its own VS Code extension. It is part of a larger extension for AWS services called AWS Toolkit. AWS Toolkit is available in the VS Code extensions store. | md | {
"tags": [
"MongoDB",
"JavaScript",
"Java",
"Python",
"AWS",
"AI"
],
"pageDescription": "",
"contentType": "Tutorial"
} | Getting Started with MongoDB and AWS Codewhisperer | 2024-05-20T17:32:23.500Z | [
-0.05912330374121666,
-0.04956725239753723,
-0.010123714804649353,
-0.0076818810775876045,
0.027913479134440422,
0.0193786658346653,
-0.010468638502061367,
0.02033318765461445,
-0.01157626323401928,
-0.004519777838140726,
0.02005293220281601,
-0.03447508439421654,
0.04998226463794708,
0.02... |
End of preview. Expand
in Data Studio
Overview
This dataset consists of chunked and embedded versions of a subset of articles from the MongoDB Developer Center.
Dataset Structure
The dataset consists of the following fields:
- sourceName: The source of the article. This value is
devcenterfor the entire dataset. - url: Link to the article
- action: Action taken on the article. This value is
createdfor the entire dataset. - body: Content of the chunk in Markdown format
- format: Format of the content. This value is
mdfor all articles. - metadata: Metadata such as tags, content type etc. associated with the articles
- title: Title of the article
- updated: The last updated date of the article
- embedding: The embedding of the chunk's content, created using the thenlpr/gte-small open-source model from Hugging Face.
Usage
This dataset can be useful for prototyping RAG applications. This is a real sample of data we have used to build the AI chatbot on our official documentation website.
Ingest Data
To experiment with this dataset using MongoDB Atlas, first create a MongoDB Atlas account.
You can then use the following script to load this dataset into your MongoDB Atlas cluster:
import os
from pymongo import MongoClient
import datasets
from datasets import load_dataset
from bson import json_util
uri = os.environ.get('MONGODB_ATLAS_URI')
client = MongoClient(uri)
db_name = 'your_database_name' # Change this to your actual database name
collection_name = 'devcenter_articles-embedded'
collection = client[db_name][collection_name]
dataset = load_dataset("MongoDB/devcenter-articles-embedded")
insert_data = []
for item in dataset['train']:
doc = json_util.loads(json_util.dumps(item))
insert_data.append(doc)
if len(insert_data) == 1000:
collection.insert_many(insert_data)
print("1000 records ingested")
insert_data = []
if len(insert_data) > 0:
collection.insert_many(insert_data)
insert_data = []
print("Data ingested successfully!")
- Downloads last month
- 18