"딥러닝을 사용하고 있지 않다면 반드시 사용해야 합니다." - Jeff Dean, Google 펠로우.
Google은 모든 사물과 모든 사람에게 인공지능(AI)을 제공한다는 사명으로 출발했습니다. 개발자와 기업이 모델을 구축 및 학습하고 이를 사용하여 추론(예측)할 수 있도록 오픈 소스 Tensorflow와 지원 라이브러리를 제공하고 있습니다. 이를 통해 유용한 엔터프라이즈 서비스를 구축하는 데는 시간이 걸릴 수 있습니다.
Google은 또한 클라우드 머신러닝 API를 통해 애플리케이션에서 매우 유용하게 사용할 수 있는 많은 인공지능 서비스를 공개했습니다. 이미지에서 특징과 텍스트 추출, 한 언어에서 다른 언어로 텍스트 번역, 텍스트에 대한 감정 분석 등을 통해 사용자 경험을 획기적으로 개선할 수 있습니다. 이러한 서비스만으로도 새로운 비즈니스와 비즈니스 모델을 구현할 수 있습니다. Google은 이 모델을 구축하고 훈련하는 데 많은 노력을 기울였습니다. 사용자는 REST API를 호출하여 머신러닝 API를 활용하기만 하면 됩니다. 이러한 API는 그 밑에 있는 심층 인프라를 이해하거나 유지 관리할 필요 없이 선언적 서비스 호출 방법의 역할을 할 뿐입니다.
머신 러닝 API에는 다음이 포함됩니다:
- 그리고 이 글이 게시될 때까지 더 많은 서비스가 추가될 것입니다.
이 모든 서비스는 REST API로 제공됩니다. 서비스에 대한 문서와 자세한 내용은 아래 Google 사이트를 참조하세요.
Couchbase 5.0에서 N1QL R&D 엔지니어인 Isha Kandaswamy는 다음과 같이 개발했습니다. CURL() 기능에 대해 작성된. CURL()을 사용하면 JSON 엔드포인트가 있는 모든 REST 서비스를 사용할 수 있습니다. 사용 예 Google 지도 API는 다음과 같습니다.. N1QL은 JSON용 SQL로 설계되었기 때문에 서비스의 JSON 결과를 N1QL에서 자연스럽게 처리할 수 있습니다.
참고: 공개적으로 사용 가능한 모든 서비스에서 인공지능 또는 기타 서비스를 사용하여 CURL()을 사용할 수 있습니다.
이 블로그에서는 간단한 N1QL 문을 사용하여 Couchbase에 있는 데이터에 직접 Google Cloud AI API를 사용하는 방법을 보여줍니다. 모든 Google Cloud 머신 러닝 API는 JSON을 반환합니다. 따라서 CURL()을 사용하여 모든 서비스를 호출할 수 있습니다. Google 비전 API, Google 번역 API, Google 자연어 API를 사용하는 예를 보여드리겠습니다.
참고: 프로젝트를 설정하고 각 서비스를 활성화한 후 전달해야 하는 API-KEY를 받아야 합니다. 아래 예시에서 확인하세요, 키를 제거했습니다. 여기에 키를 넣으세요를 키로 바꿔야 합니다.

몇 가지 API를 사용해 보겠습니다.
1. 사용 Google 비전 API:
고객이 자동차 사진과 신분증 사진을 업로드하는 보험 회사가 될 수 있습니다. 성적표 이미지를 받는 대학일 수도 있습니다. 이미지의 텍스트를 추출하여 정확성을 높이고, 사용자 경험을 개선하며, 필요할 때 쉽게 검색할 수 있도록 하려는 경우입니다.
Google은 전 세계의 텍스트를 정리하는 데서 나아가 전 세계의 멀티미디어 콘텐츠를 정리하고 있습니다. Vision API는 이미지 내에서 많은 메타데이터를 추출하고 해당 정보를 웹에서 제공되는 정보 및 기타 이미지와 연관시킬 수 있는 강력한 기능을 제공합니다.

Google Vision API를 사용하여 이미지에 대한 전체 분석을 해보겠습니다.
|
1 2 3 4 5 6 7 |
select imagetext from curl("https://vision.googleapis.com/v1/images:annotate?key=PUT YOUR KEY HERE", {"request": "POST", "header":"Content-Type: application/json", "data": '{ "requests": [ { "image": { "source": { "imageUri": "https://www.couchbase.com/blog/wp-content/uploads/2018/01/Screen-Shot-2018-01-21-at-6.50.38-PM.png" } }, "features": [ { "type": "TEXT_DETECTION" } ] } ] }'}) AS imagetext |
이 쿼리는 모든 다각형과 관련 텍스트를 설명하는 12만 개의 방대한 응답을 반환합니다. 답변은 다음과 같습니다.. 다시 쿼리를 실행하여 필요한 항목을 투영해 보겠습니다. Vision API는 연결된 문자열 목록을 반환합니다. N1QL의 SPLIT() 또는 TOKENS() 함수를 사용하여 각 문자열을 개별적으로 가져올 수 있습니다.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
select r.fullTextAnnotation.text from curl("https://vision.googleapis.com/v1/images:annotate?key=PUT YOUR KEY HERE", {"request": "POST", "header":"Content-Type: application/json", "data": '{ "requests": [ { "image": { "source": { "imageUri": "https://www.couchbase.com/blog/wp-content/uploads/2018/01/Screen-Shot-2018-01-21-at-6.50.38-PM.png" } }, "features": [ { "type": "TEXT_DETECTION" } ] } ] }'}) AS imagetext UNNEST imagetext.responses r ; { "requestID": "c1e41d74-2522-4de9-84ef-2730cae1aebc", "signature": { "text": "json" }, "results": [ { "text": "APPLICATION SERVER\nAPPLICATION SERVER\nCLIENT LIBRARY\nCLIENT LIBRARY\nSDK\nSDK\nCluster\nManager\nCluster\nManager\nCluster\nManager\nCluster\nManager\nCluster\nManager\nData\nService\nQuery\nService\nIndex\nService\nSearch\nService\nAnalytics\nService*\nManaged Cache\nStorage\nCouchbase Server 1\nManaged Cache\nStorage\nCouchbase Server 3\nManaged Cache\nStorage\nCouchbase Server 4\nManaged Cache\nStorage\nCouchbase Server\nCouchbase Server\nServer Cluster\n" } ], "status": "success", "metrics": { "elapsedTime": "1.906194164s", "executionTime": "1.906166141s", "resultCount": 1, "resultSize": 499 } } |
2. Google 번역 API
이 API가 말하는 대로 작동합니다: 한 언어에서 다른 언어로 번역합니다. 소스 언어를 자동으로 감지할 수 있습니다. 이 API의 인수는 단순히 소스 콘텐츠와 대상 언어입니다. 이 예에서는 호텔에 대한 고객 리뷰를 영어에서 프랑스어로 번역해 보겠습니다.
|
1 2 3 4 5 6 7 8 9 |
SELECT ginfo FROM ( SELECT r.content as english, curl("https://translation.googleapis.com/language/translate/v2?key=PUT YOUR KEYS HERE", {"request": "POST", "header":"Content-Type: application/json", "data": mydata }) AS french FROM `travel-sample` h USE KEYS "hotel_10142" UNNEST h.reviews r LET mydata = '{ "q":"' || r.content || '", "target": "fr"}') AS ginfo; |
프랑스어 번역이 포함된 쿼리 결과는 다음과 같습니다:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
{ "requestID": "a388a2a4-da40-42df-9af6-93a83f8f3cf1", "signature": { "ginfo": "json" }, "results": [ { "ginfo": { "english": "This has got to be the worse experience I have ever had at a hotel. Our reservation was placed two months in advance for a non-smoking room with two beds from July 2-7, 2010. We are staying five nights at $190 a night and this is what we got, a smoking room with one bed, and was only told at the front desk that it was going to be a smoking room, nothing about the one bed, when she asked us how many beds we needed, oh they provided a roll-a-way, only thing is I had to move the chair into the hallway to fit the bed. The t.v. was older than me and the speaker was shot. the bathroom was so small you have to step into the tub to close the door, no fridge in the room, doors are cheap and horrible. only sheets on the bed no blankets/quilts, plus on top of that, i had to pay $14.95 a night for internet. I will never recommend this hotel! how can you take a reservation and state that it will be held till 10am the following morning, yet not provide what was requested in the reservation? What if someone in my party was allergic to smoke, asthmatic, or worse... we wouldn't have gotten a room? completely unacceptable no wonder I will continue to stay at the comfort suites... free internet, modern amenities(flat screens) oh and $85 a night. unsatisfied doesn't even come close to how I feel. the only good thing out of this whole stay was the hot cookie when I got here and mine wasn't even hot. You can take that cookie and... well i'm sure you can figure out the rest. Thanx for nothing!", "french": { "data": { "translations": [ { "detectedSourceLanguage": "en", "translatedText": "Cela doit être la pire expérience que j'ai jamais eu dans un hôtel. Notre réservation a été placée deux mois à l'avance pour une chambre non-fumeurs avec deux lits du 2 au 7 juillet 2010. Nous restons cinq nuits à 190 $ la nuit et c'est ce que nous avons eu, une chambre fumeurs avec un lit, et On m'a seulement dit à la réception que ça allait être une chambre fumeur, rien à propos du lit, quand elle nous a demandé combien de lits nous avions besoin, oh ils ont fourni un roll-a-way, seule chose que je devais déplacer le Chaise dans le couloir pour s'adapter au lit. La télé était plus vieille que moi et l'orateur a été abattu. La salle de bain était si petite que vous devez marcher dans la baignoire pour fermer la porte, pas de frigo dans la chambre, les portes sont bon marché et horrible. seulement des draps sur le lit pas de couvertures / couettes, en plus de cela, j'ai dû payer 14,95 $ la nuit pour internet. Je ne recommanderai jamais cet hôtel! Comment pouvez-vous prendre une réservation et indiquer qu'il se tiendra jusqu'à 10 heures du matin le lendemain, mais ne pas fournir ce qui était demandé dans la réservation? Et si quelqu'un de mon groupe était allergique à la fumée, asthmatique ou pire ... nous n'aurions pas eu de chambre? complètement inacceptable pas étonnant je vais continuer à rester dans les suites de confort ... Internet gratuit, des équipements modernes (écrans plats) oh et 85 $ la nuit. insatisfait ne se rapproche même pas de ce que je ressens. La seule bonne chose de tout ce séjour était le cookie chaud quand je suis arrivé et le mien n'était même pas chaud. Vous pouvez prendre ce cookie et ... eh bien, je suis sûr que vous pouvez comprendre le reste. Merci pour rien!" } ] } } } }, { "ginfo": { "english": "OK - I booked this place about 8 weeks prior to travel, when the rooms were still $116 for a Saturday night on Doubletree/Hilton site. As the travel date drew close, I would reprice and the rate climbed to over $200. $116 was a bargain, but the place isn't worth $200. I had room 1022 - very small, some mildew on in the closet in the corner, and right down the hall from the housekeeping closets (they banged their doors day and night). The bed was comfortable and the staff was very courteous. I didn't know this when I booked the hotel, but I was thrilled to see it was at the same intersection as Harrah's Casino so I lost $50. The hotel is also right at a trolley car stop on Canal Street. $116 - yep, I'ld stay there again in a heartbeat. $200 - no can do. Book early and tolerate the inconveniences in exchange for a bargain price.", "french": { "data": { "translations": [ { "detectedSourceLanguage": "en", "translatedText": "D'accord, j'ai réservé cet hôtel environ 8 semaines avant de partir, quand les chambres étaient toujours 116 pour un samedi soir sur Doubletree / Hilton. Comme la date du voyage se rapprochait, je voudrais réévaluer et le taux a grimpé à plus de 200 $. 116 $ était une bonne affaire, mais l'endroit ne vaut pas 200 $. J'avais la chambre 1022 - très petite, un peu de moisissure dans le placard dans le coin, et juste dans le couloir des placards de ménage (ils ont frappé leurs portes jour et nuit). Le lit était confortable et le personnel était très courtois. Je ne savais pas cela quand j'ai réservé cet hôtel, mais j'ai été ravi de voir que c'était au même carrefour que Harrah's Casino, j'ai perdu 50 $. L'hôtel est également juste à côté d'un arrêt de tramway sur Canal Street. 116 $ - oui, j'y retournerais sans hésiter. 200 $ - ne peut pas faire. Réservez tôt et tolérer les inconvénients en échange d'un prix d'aubaine." } ] } } } }, { "ginfo": { "english": "I was impressed with my room and the great service I received at the front desk. I found the staff helpful and very pleasant. The location was great with easy walking distances to the French Quarter, other points of interest and great restaurants in the immediate area. Room service was on time and my breakfast arrived hot and ready to enjoy. I would recommend this hotel for the start of a great stay in Big Easy.", "french": { "data": { "translations": [ { "detectedSourceLanguage": "en", "translatedText": "J'ai été impressionné par ma chambre et le super service que j'ai reçu à la réception. J'ai trouvé le personnel serviable et très agréable. L'emplacement était génial, à quelques minutes de marche du quartier français, d'autres points d'intérêt et d'excellents restaurants dans les environs immédiats. Le service de chambre était à l'heure et mon petit déjeuner est arrivé chaud et prêt à profiter. Je recommande cet hôtel pour le début d'un excellent séjour à Big Easy." } ] } } } }, { "ginfo": { "english": "The hotel is located conveniently on Canal Street at the edge of the French Quarter near the river. When we arrived, the rooms were ready to go and checking was painless, the cookies were awesome! The louge downstairs was a good place to catch a drink before heading out each night. We were within walking distance to everything in the French Quarter and catching a cab in front of the hotel was easy. The trolley has a stop in front of the hotel, Harrah's is next door, the aquarium , the mall and a move theater are all across the street. The hotel restaurant was good, not the best considering it's New Orleans, but good for hotel food. I didn't have a car this trip, but you have to pay for parking in most places in the quarter. The pool is small, but nice to hang out at mid afternoon and there is a small gym for a quick work out. I've staryed in many places in the French Quarter over the years and this is one of the better experiences I have had. I was pleasantly suprizes at how much I liked the location.", "french": { "data": { "translations": [ { "detectedSourceLanguage": "en", "translatedText": "L'hôtel est idéalement situé sur Canal Street, au bord du quartier français près de la rivière. Quand nous sommes arrivés, les chambres étaient prêtes à partir et les formalités de départ étaient indolores, les cookies étaient géniaux! Le rez-de-chaussée était un bon endroit pour prendre un verre avant de partir chaque nuit. Nous étions à distance de marche de tout dans le quartier français et prendre un taxi en face de l'hôtel était facile. Le tramway s'arrête devant l'hôtel, Harrah est à côté, l'aquarium, le centre commercial et un théâtre de déménagement sont tous de l'autre côté de la rue. Le restaurant de l'hôtel était bien, pas le meilleur étant donné que c'est la Nouvelle-Orléans, mais bon pour la nourriture de l'hôtel. Je n'avais pas de voiture ce voyage, mais vous devez payer pour le stationnement dans la plupart des endroits dans le quartier. La piscine est petite, mais agréable de sortir en milieu d'après-midi et il y a une petite salle de gym pour faire du sport. Je me suis entretenu dans de nombreux endroits dans le quartier français au cours des années et c'est l'une des meilleures expériences que j'ai eu. J'ai été agréablement suprizes à quel point j'ai aimé l'emplacement." } ] } } } }, { "ginfo": { "english": "The Doubltree is located near so many attractions, we hardly ever needed a cab the whole time we were there. Clean rooms that were well maintained were a treat to come home to after a long day. I never experienced one issue or problem the entire time I was there, from a warm a welcoming check-in (with a great cookie!) to an efficent check-out. I would certainly reccomend the hotel to anyone I knew that was traveling to the Big Easy.", "french": { "data": { "translations": [ { "detectedSourceLanguage": "en", "translatedText": "Le Doubltree est situé près de tant d'attractions, nous n'avons presque jamais eu besoin d'un taxi pendant tout notre séjour. Les chambres propres qui étaient bien entretenues étaient un régal pour rentrer à la maison après une longue journée. Je n'ai jamais connu un problème ou problème tout le temps où j'étais là-bas, d'un accueil chaleureux (avec un bon cookie!) À un départ efficace. Je recommanderais cet hôtel à tous ceux que je connaissais qui voyageaient au Big Easy." } ] } } } }, { "ginfo": { "english": "We stayed at the Doubletree Hotel New Orleans for the first time on February 14, 2009. The good: check in was quick, the rooms were comfortable and very clean. I forgot some amenities and staff were very quick to respond with bringing up what I needed. All staff were very polite. One bad: the walls are paper thin, you can literally hear every word in the rooms next to you and in the hallway. I would stay here again for the ideal location, but if you need a good nights rest, reconsider due to noise.", "french": { "data": { "translations": [ { "detectedSourceLanguage": "en", "translatedText": "Nous avons séjourné au Doubletree Hotel New Orleans pour la première fois le 14 février 2009. Le bon: l'enregistrement a été rapide, les chambres étaient confortables et très propres. J'ai oublié quelques équipements et le personnel était très rapide pour répondre à ce que j'ai besoin de ce dont j'avais besoin. Tout le personnel était très poli. Un mauvais: les murs sont très fins, vous pouvez littéralement entendre chaque mot dans les chambres à côté de vous et dans le couloir. Je reviendrais ici pour l'emplacement idéal, mais si vous avez besoin de bonnes nuits de repos, reconsidérer à cause du bruit." } ] } } } } ], "status": "success", "metrics": { "elapsedTime": "3.604491133s", "executionTime": "3.604475374s", "resultCount": 6, "resultSize": 13090 } } |
프랑스어를 잘 이해하지 못하기 때문에 리뷰를 다음과 같이 번역했습니다. 칸나다어로 번역했습니다. 번역은 기계치고는 괜찮은 편이었습니다. 일부 문장은 복잡했지만(거의 옛 칸나다어처럼 들렸습니다) 전반적으로 이해할 수 있었습니다. 다음은 번역본입니다.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
> SELECT ginfo FROM ( select r.content, curl("https://translation.googleapis.com/language/translate/v2?key=PUT YOUR KEY HERE", {"request": "POST", "header":"Content-Type: application/json", "data": mydata }) as kannada from `travel-sample` h use keys "hotel_10142" unnest h.reviews r LET mydata = '{ "q":"' || r.content || '", "source": "en", "target": "kn"}') ginfo; { "requestID": "079f9dba-2da2-4941-b1be-70865997ec51", "signature": { "ginfo": "json" }, "results": [ { "ginfo": { "content": "This has got to be the worse experience I have ever had at a hotel. Our reservation was placed two months in advance for a non-smoking room with two beds from July 2-7, 2010. We are staying five nights at $190 a night and this is what we got, a smoking room with one bed, and was only told at the front desk that it was going to be a smoking room, nothing about the one bed, when she asked us how many beds we needed, oh they provided a roll-a-way, only thing is I had to move the chair into the hallway to fit the bed. The t.v. was older than me and the speaker was shot. the bathroom was so small you have to step into the tub to close the door, no fridge in the room, doors are cheap and horrible. only sheets on the bed no blankets/quilts, plus on top of that, i had to pay $14.95 a night for internet. I will never recommend this hotel! how can you take a reservation and state that it will be held till 10am the following morning, yet not provide what was requested in the reservation? What if someone in my party was allergic to smoke, asthmatic, or worse... we wouldn't have gotten a room? completely unacceptable no wonder I will continue to stay at the comfort suites... free internet, modern amenities(flat screens) oh and $85 a night. unsatisfied doesn't even come close to how I feel. the only good thing out of this whole stay was the hot cookie when I got here and mine wasn't even hot. You can take that cookie and... well i'm sure you can figure out the rest. Thanx for nothing!", "kannada": { "data": { "translations": [ { "translatedText": "ಹೋಟೆಲ್ನಲ್ಲಿ ನಾನು ಹೊಂದಿದ್ದ ಕೆಟ್ಟ ಅನುಭವ ಎಂದು ಇದು ತಿಳಿದು ಬಂದಿದೆ. ನಮ್ಮ ಕಾಯ್ದಿರಿಸುವಿಕೆ ಎರಡು ತಿಂಗಳ ಮುಂಚಿತವಾಗಿ ಜುಲೈ 2, 7 ರಿಂದ 2010 ರವರೆಗೆ ಎರಡು ಹಾಸಿಗೆಯೊಂದಿಗೆ ಧೂಮಪಾನ ಕೊಠಡಿಯನ್ನು ಇರಿಸಿದೆ. ನಾವು ರಾತ್ರಿಗೆ $ 190 ಗೆ ಐದು ರಾತ್ರಿಗಳು ಇರುತ್ತಿದ್ದೇವೆ ಮತ್ತು ಇದು ನಮಗೆ ಸಿಕ್ಕಿತು, ಒಂದು ಹಾಸಿಗೆಯೊಂದಿಗೆ ಧೂಮಪಾನ ಕೊಠಡಿ, ಕೇವಲ ಮುಂಭಾಗದ ಮೇಜಿನ ಬಳಿ ಅದು ಧೂಮಪಾನ ಕೊಠಡಿ ಎಂದು ಹೇಳುತ್ತಿದ್ದೆವು, ಒಂದು ಹಾಸಿಗೆಯ ಬಗ್ಗೆ ಏನೂ ಇಲ್ಲ, ನಮಗೆ ಎಷ್ಟು ಹಾಸಿಗೆಗಳು ಬೇಕಾಗಿವೆ ಎಂದು ಕೇಳಿದಾಗ, ಅವರು ರೋಲ್-ಎ-ವೇವನ್ನು ಒದಗಿಸಿದರು, ಕೇವಲ ವಿಷಯ ನಾನು ಹಾಸಿಗೆಯನ್ನು ಹೊಂದಲು ಹಜಾರದ ಒಳಗೆ ಕುರ್ಚಿ. ಟಿವಿ ನನ್ನಂತೆಯೇ ಹಳೆಯದು ಮತ್ತು ಸ್ಪೀಕರ್ ಚಿತ್ರೀಕರಿಸಲಾಯಿತು. ಬಾತ್ರೂಮ್ ಚಿಕ್ಕದಾಗಿದೆ, ಬಾಗಿಲನ್ನು ಮುಚ್ಚಲು ನೀವು ಟಬ್ಬಿನೊಳಗೆ ಹೆಜ್ಜೆ ಹಾಕಬೇಕು, ಕೋಣೆಯಲ್ಲಿ ಯಾವುದೇ ಫ್ರಿಜ್ ಇಲ್ಲ, ಬಾಗಿಲು ಅಗ್ಗವಾಗಿದ್ದು ಭಯಾನಕವಾಗಿದೆ. ಹಾಸಿಗೆಯ ಮೇಲೆ ಮಾತ್ರ ಹಾಳೆಗಳು ಕಂಬಳಿಗಳು / ಕ್ವಿಲ್ಟ್ಸ್ ಮಾತ್ರವಲ್ಲ, ಅದರ ಮೇಲೆ, ನಾನು ಅಂತರ್ಜಾಲಕ್ಕಾಗಿ $ 14.95 ರಷ್ಟು ಹಣವನ್ನು ಪಾವತಿಸಬೇಕಾಯಿತು. ನಾನು ಈ ಹೋಟೆಲ್ಗೆ ಎಂದಿಗೂ ಶಿಫಾರಸು ಮಾಡುವುದಿಲ್ಲ! ಮುಂದಿನ ದಿನ ಬೆಳಿಗ್ಗೆ 10 ಗಂಟೆಗೆ ನಡೆಯಲಿದೆ ಎಂದು ಮೀಸಲಾತಿ ಮತ್ತು ರಾಜ್ಯವನ್ನು ನೀವು ಹೇಗೆ ತೆಗೆದುಕೊಳ್ಳಬಹುದು, ಆದರೆ ಮೀಸಲಾತಿಯಲ್ಲಿ ಏನು ವಿನಂತಿಸಲಾಗಿದೆ? ನನ್ನ ಪಾರ್ಟಿಯಲ್ಲಿ ಯಾರೋ ಹೊಗೆ, ಅಸ್ತಮ, ಅಥವಾ ಕೆಟ್ಟದ್ದಕ್ಕೆ ಅಲರ್ಜಿಯಾಗಿದ್ದರೆ ... ನಾವು ಒಂದು ಕೊಠಡಿಯನ್ನು ಪಡೆದಿರಲಿಲ್ಲವೆ? ಸಂಪೂರ್ಣವಾಗಿ ಸ್ವೀಕಾರಾರ್ಹವಲ್ಲ ಯಾವುದೇ ಆಶ್ಚರ್ಯ ನಾನು ಸೌಕರ್ಯಗಳಿಗೆ ಕೋಣೆಗಳು ನಲ್ಲಿ ಉಳಿಯಲು ಮುಂದುವರಿಯುತ್ತದೆ ... ಉಚಿತ ಇಂಟರ್ನೆಟ್, ಆಧುನಿಕ ಸೌಕರ್ಯಗಳು (ಫ್ಲಾಟ್ ಪರದೆಗಳು) ಓಹ್ ಮತ್ತು $ 85 ಒಂದು ರಾತ್ರಿ. ಅತೃಪ್ತರಾಗಿದ್ದರೂ ನಾನು ಹೇಗೆ ಭಾವಿಸುತ್ತೇನೆ ಎಂಬುದರ ಹತ್ತಿರ ಬರುವುದಿಲ್ಲ. ನಾನು ಇಲ್ಲಿಗೆ ಬಂದಾಗ ಮತ್ತು ಗಣಿ ಕೂಡ ಬಿಸಿಯಾಗಿರಲಿಲ್ಲವಾದ್ದರಿಂದ ಈ ಸಂಪೂರ್ಣ ವಾಸ್ತವ್ಯದಲ್ಲೇ ಇರುವ ಏಕೈಕ ಒಳ್ಳೆಯದು ಬಿಸಿ ಕುಕೀ. ನೀವು ಆ ಕುಕೀ ತೆಗೆದುಕೊಳ್ಳಬಹುದು ಮತ್ತು ... ಚೆನ್ನಾಗಿ ಉಳಿದಿರುವುದನ್ನು ನೀವು ಲೆಕ್ಕಾಚಾರ ಮಾಡಬಹುದು ಎಂದು ನನಗೆ ಖಾತ್ರಿಯಿದೆ. ಥಾಂಕ್ಸ್ ಏನೂ ಇಲ್ಲ!" } ] } } } }, { "ginfo": { "content": "OK - I booked this place about 8 weeks prior to travel, when the rooms were still $116 for a Saturday night on Doubletree/Hilton site. As the travel date drew close, I would reprice and the rate climbed to over $200. $116 was a bargain, but the place isn't worth $200. I had room 1022 - very small, some mildew on in the closet in the corner, and right down the hall from the housekeeping closets (they banged their doors day and night). The bed was comfortable and the staff was very courteous. I didn't know this when I booked the hotel, but I was thrilled to see it was at the same intersection as Harrah's Casino so I lost $50. The hotel is also right at a trolley car stop on Canal Street. $116 - yep, I'ld stay there again in a heartbeat. $200 - no can do. Book early and tolerate the inconveniences in exchange for a bargain price.", "kannada": { "data": { "translations": [ { "translatedText": "ಸರಿ - ಈ ಸ್ಥಳವು ಪ್ರಯಾಣಕ್ಕೆ 8 ವಾರಗಳ ಮುಂಚಿತವಾಗಿ, ಶನಿವಾರ ರಾತ್ರಿ ಡಬಲ್ಟ್ರೀ / ಹಿಲ್ಟನ್ ಸೈಟ್ನಲ್ಲಿ ಕೊಠಡಿಗಳು ಇನ್ನೂ $ 116 ಆಗಿದ್ದಾಗ ನಾನು ಈ ಸ್ಥಳವನ್ನು ಗೊತ್ತು ಮಾಡಿದೆ. ಪ್ರಯಾಣದ ದಿನಾಂಕ ಹತ್ತಿರ ಬಂದಾಗ, ನಾನು ಮರುಪಾವತಿ ಮಾಡುತ್ತೇನೆ ಮತ್ತು ದರವು $ 200 ಕ್ಕಿಂತ ಹೆಚ್ಚಿದೆ. $ 116 ಒಂದು ಚೌಕಾಶಿಯಾಗಿತ್ತು, ಆದರೆ ಸ್ಥಳವು $ 200 ಮೌಲ್ಯದ್ದಾಗಿಲ್ಲ. ನಾನು ಕೋಣೆ 1022 ಅನ್ನು ಹೊಂದಿದ್ದೆ - ಬಹಳ ಚಿಕ್ಕದಾದ, ಕೆಲವು ಮೂಲೆಯಲ್ಲಿರುವ ಶಿಲೀಂಧ್ರ, ಮನೆಮನೆಯ ಮುಚ್ಚುಮರೆಯಿಂದ ಹಾಲ್ ಕೆಳಗೆ ಬಿದ್ದ (ಅವರು ದಿನ ಮತ್ತು ರಾತ್ರಿ ತಮ್ಮ ಬಾಗಿಲುಗಳನ್ನು ಹೊಡೆಯುತ್ತಿದ್ದರು). ಹಾಸಿಗೆ ಆರಾಮದಾಯಕ ಮತ್ತು ಸಿಬ್ಬಂದಿ ಬಹಳ ವಿನಯಶೀಲರಾಗಿದ್ದರು. ನಾನು ಹೋಟೆಲ್ ಅನ್ನು ಬುಕ್ ಮಾಡುತ್ತಿರುವಾಗ ನಾನು ಇದನ್ನು ತಿಳಿದಿರಲಿಲ್ಲ, ಆದರೆ ಇದು ಹಾರ್ರಾಹ್ ಕ್ಯಾಸಿನೊದಲ್ಲಿ ಅದೇ ಛೇದಕದಲ್ಲಿದೆ ಎಂದು ನನಗೆ ಥ್ರಿಲ್ಡ್ ಮಾಡಲಾಯಿತು, ಹಾಗಾಗಿ ನಾನು $ 50 ಕಳೆದುಕೊಂಡೆ. ಕಾನಾಲ್ ಸ್ಟ್ರೀಟ್ನಲ್ಲಿರುವ ಟ್ರಾಲಿ ಕಾರ್ ಸ್ಟಾಪ್ನಲ್ಲಿ ಹೋಟೆಲ್ ಸಹ ಸರಿಯಾಗಿದೆ. $ 116 - ಹೌದು, ನಾನು ಮತ್ತೆ ಹೃದಯ ಬಡಿತದಲ್ಲಿ ಇರುತ್ತೇನೆ. $ 200 - ಇಲ್ಲ. ಚೌಕಾಶಿ ಬೆಲೆಗೆ ವಿನಿಮಯವಾಗಿ ಅನನುಕೂಲತೆಗಳನ್ನು ಪ್ರಾರಂಭಿಸಿ ಮತ್ತು ಸಹಿಸಿಕೊಳ್ಳಿ." } ] } } } }, { "ginfo": { "content": "I was impressed with my room and the great service I received at the front desk. I found the staff helpful and very pleasant. The location was great with easy walking distances to the French Quarter, other points of interest and great restaurants in the immediate area. Room service was on time and my breakfast arrived hot and ready to enjoy. I would recommend this hotel for the start of a great stay in Big Easy.", "kannada": { "data": { "translations": [ { "translatedText": "ನನ್ನ ಕೊಠಡಿ ಮತ್ತು ನಾನು ಮುಂಭಾಗದ ಮೇಜಿನ ಬಳಿ ಪಡೆದ ಅತ್ಯುತ್ತಮ ಸೇವೆಯಿಂದ ಪ್ರಭಾವಿತನಾಗಿದ್ದೆ. ನಾನು ಸಿಬ್ಬಂದಿ ಸಹಾಯಕವಾಗಿದೆಯೆ ಮತ್ತು ಅತ್ಯಂತ ಆಹ್ಲಾದಕರ ಎಂದು ಕಂಡುಬಂದಿಲ್ಲ. ಈ ಸ್ಥಳವು ಫ್ರೆಂಚ್ ಕ್ವಾರ್ಟರ್ಗೆ ಸುಲಭ ವಾಕಿಂಗ್ ದೂರದೊಂದಿಗೆ, ಇತರ ಪ್ರದೇಶದ ಆಸಕ್ತಿಗಳು ಮತ್ತು ತಕ್ಷಣದ ಪ್ರದೇಶದ ದೊಡ್ಡ ರೆಸ್ಟೊರೆಂಟ್ಗಳೊಂದಿಗೆ ಉತ್ತಮವಾಗಿತ್ತು. ರೂಮ್ ಸೇವೆಯು ಸಮಯಕ್ಕೆ ಇತ್ತು ಮತ್ತು ನನ್ನ ಉಪಹಾರವು ಬಿಸಿಯಾಗಿ ಬಂದು ಆನಂದಿಸಲು ಸಿದ್ಧವಾಗಿದೆ. ಬಿಗ್ ಈಸಿನಲ್ಲಿ ಉತ್ತಮ ವಾಸ್ತವ್ಯದ ಪ್ರಾರಂಭಕ್ಕಾಗಿ ನಾನು ಈ ಹೋಟೆಲ್ ಅನ್ನು ಶಿಫಾರಸು ಮಾಡಿದ್ದೇನೆ." } ] } } } }, { "ginfo": { "content": "The hotel is located conveniently on Canal Street at the edge of the French Quarter near the river. When we arrived, the rooms were ready to go and checking was painless, the cookies were awesome! The louge downstairs was a good place to catch a drink before heading out each night. We were within walking distance to everything in the French Quarter and catching a cab in front of the hotel was easy. The trolley has a stop in front of the hotel, Harrah's is next door, the aquarium , the mall and a move theater are all across the street. The hotel restaurant was good, not the best considering it's New Orleans, but good for hotel food. I didn't have a car this trip, but you have to pay for parking in most places in the quarter. The pool is small, but nice to hang out at mid afternoon and there is a small gym for a quick work out. I've staryed in many places in the French Quarter over the years and this is one of the better experiences I have had. I was pleasantly suprizes at how much I liked the location.", "kannada": { "data": { "translations": [ { "translatedText": "ನದಿಯ ಬಳಿ ಫ್ರೆಂಚ್ ಕ್ವಾರ್ಟರ್ನ ಅಂಚಿನಲ್ಲಿರುವ ಕಾನಾಲ್ ಸ್ಟ್ರೀಟ್ನಲ್ಲಿ ಈ ಹೋಟೆಲ್ ಅನುಕೂಲಕರವಾಗಿ ಇದೆ. ನಾವು ಬಂದಾಗ ಕೊಠಡಿಗಳು ಹೋಗಲು ಸಿದ್ಧವಾಗಿದ್ದವು ಮತ್ತು ನೋವುರಹಿತವಾಗಿದ್ದವು, ಕುಕೀಗಳು ಮನಮೋಹಕವಾಗಿತ್ತು! ಪ್ರತಿ ರಾತ್ರಿ ಶಿರೋನಾಮೆ ಮಾಡುವ ಮೊದಲು ಪಾನೀಯವನ್ನು ಹಿಡಿಯಲು ಉತ್ತಮ ಸ್ಥಳವಾಗಿದೆ. ನಾವು ಫ್ರೆಂಚ್ ಕ್ವಾರ್ಟರ್ನಲ್ಲಿ ಎಲ್ಲದರ ಕಡೆಗೆ ನಡೆಯುತ್ತಿದ್ದೆವು ಮತ್ತು ಹೋಟೆಲ್ ಮುಂದೆ ಕ್ಯಾಬ್ ಅನ್ನು ಹಿಡಿಯುವುದು ಸುಲಭವಾಗಿದೆ. ಹೋಟೆಲ್ ಮುಂದೆ ಮುಂಭಾಗದಲ್ಲಿ ಟ್ರಾಲಿಯು ನಿಲ್ಲುತ್ತದೆ, ಹರ್ರಾಹ್ಸ್ ಮುಂದಿನ ಬಾಗಿಲು, ಅಕ್ವೇರಿಯಂ, ಮಾಲ್ ಮತ್ತು ಚಲಿಸುವ ಥಿಯೇಟರ್ ಎಲ್ಲಾ ಬೀದಿಗಳಲ್ಲಿದೆ. ಹೊಟೇಲ್ ರೆಸ್ಟೊರೆಂಟ್ ಒಳ್ಳೆಯದು, ಅದು ನ್ಯೂ ಒರ್ಲಿಯನ್ಸ್ ಅನ್ನು ಪರಿಗಣಿಸಿಲ್ಲ, ಆದರೆ ಹೋಟೆಲ್ ಆಹಾರಕ್ಕೆ ಉತ್ತಮವಾಗಿದೆ. ನಾನು ಈ ಟ್ರಿಪ್ ಅನ್ನು ಹೊಂದಿಲ್ಲ, ಆದರೆ ಕಾಲುಭಾಗದಲ್ಲಿ ಹೆಚ್ಚಿನ ಸ್ಥಳಗಳಲ್ಲಿ ನೀವು ಪಾರ್ಕಿಂಗ್ಗೆ ಪಾವತಿಸಬೇಕಾಗುತ್ತದೆ. ಪೂಲ್ ಚಿಕ್ಕದಾಗಿದೆ, ಆದರೆ ಮಧ್ಯ ಮಧ್ಯಾಹ್ನ ಹ್ಯಾಂಗ್ ಔಟ್ ಮಾಡಲು ಉತ್ತಮವಾಗಿದೆ ಮತ್ತು ತ್ವರಿತ ಕೆಲಸಕ್ಕಾಗಿ ಸಣ್ಣ ಜಿಮ್ ಇರುತ್ತದೆ. ನಾನು ವರ್ಷಗಳಲ್ಲಿ ಫ್ರೆಂಚ್ ಕ್ವಾರ್ಟರ್ನಲ್ಲಿ ಅನೇಕ ಸ್ಥಳಗಳಲ್ಲಿ ನಿಂತಿರುತ್ತೇನೆ ಮತ್ತು ನಾನು ಹೊಂದಿದ್ದ ಉತ್ತಮ ಅನುಭವಗಳಲ್ಲಿ ಒಂದಾಗಿದೆ. ನಾನು ಸ್ಥಳವನ್ನು ಎಷ್ಟು ಇಷ್ಟಪಟ್ಟಿದ್ದೇನೆಂದರೆ ನನಗೆ ಸಂತೋಷಕರವಾದ ಕೊಡುಗೆಯಾಗಿದೆ." } ] } } } }, { "ginfo": { "content": "The Doubltree is located near so many attractions, we hardly ever needed a cab the whole time we were there. Clean rooms that were well maintained were a treat to come home to after a long day. I never experienced one issue or problem the entire time I was there, from a warm a welcoming check-in (with a great cookie!) to an efficent check-out. I would certainly reccomend the hotel to anyone I knew that was traveling to the Big Easy.", "kannada": { "data": { "translations": [ { "translatedText": "ಡಬಲ್ಟ್ರೀ ಹಲವಾರು ಆಕರ್ಷಣೆಗಳ ಬಳಿ ಇದೆ, ನಾವು ಅಲ್ಲಿದ್ದ ಸಂಪೂರ್ಣ ಸಮಯಕ್ಕೆ ಕ್ಯಾಬ್ಗೆ ಬೇಕಾಗಲಿಲ್ಲ. ಸುದೀರ್ಘ ಕಾಲದ ನಂತರ ಮನೆಗೆ ಬರಲು ಒಂದು ಸತ್ಕಾರದ ವಿಧಾನವನ್ನು ಚೆನ್ನಾಗಿ ನಿರ್ವಹಿಸಲಾಗಿರುವ ಸ್ವಚ್ಛ ಕೊಠಡಿಗಳು. ನಾನು ಅಲ್ಲಿದ್ದ ಸಂಪೂರ್ಣ ಸಮಯದ ಒಂದು ಸಮಸ್ಯೆಯನ್ನು ಅಥವಾ ಸಮಸ್ಯೆಯನ್ನು ನಾನು ಅನುಭವಿಸಲಿಲ್ಲ, ಬೆಚ್ಚಗಿನ ಸ್ವಾಗತ ಪರಿಶೀಲನೆಯಿಂದ (ಉತ್ತಮ ಕುಕಿ ಯೊಂದಿಗೆ) ಪರಿಣಾಮಕಾರಿ ಚೆಕ್-ಔಟ್ಗೆ. ನಾನು ಬಿಗ್ ಈಸಿಗೆ ಹೋಗುತ್ತಿದ್ದೇನೆ ಎಂದು ನಾನು ತಿಳಿದಿರುವ ಎಲ್ಲರಿಗೂ ಹೋಟೆಲ್ ಅನ್ನು ಖಂಡಿತವಾಗಿಯೂ ಮರುಸಂಗ್ರಹಿಸುತ್ತೇನೆ." } ] } } } }, { "ginfo": { "content": "We stayed at the Doubletree Hotel New Orleans for the first time on February 14, 2009. The good: check in was quick, the rooms were comfortable and very clean. I forgot some amenities and staff were very quick to respond with bringing up what I needed. All staff were very polite. One bad: the walls are paper thin, you can literally hear every word in the rooms next to you and in the hallway. I would stay here again for the ideal location, but if you need a good nights rest, reconsider due to noise.", "kannada": { "data": { "translations": [ { "translatedText": "ಫೆಬ್ರುವರಿ 14, 2009 ರಂದು ನಾವು ಮೊದಲ ಬಾರಿಗೆ ಡಬ್ಟ್ರೀ ಹೋಟೆಲ್ ನ್ಯೂ ಓರ್ಲಿಯನ್ಸ್ನಲ್ಲಿ ನೆಲೆಸಿದ್ದೇವೆ. ಒಳ್ಳೆಯದು: ಚೆಕ್ ಇನ್ ತ್ವರಿತವಾಗಿದ್ದು, ಕೊಠಡಿಗಳು ಆರಾಮದಾಯಕ ಮತ್ತು ಸ್ವಚ್ಛವಾಗಿರುತ್ತವೆ. ನಾನು ಅಗತ್ಯವಿರುವದನ್ನು ತರುವುದರೊಂದಿಗೆ ಪ್ರತಿಕ್ರಿಯಿಸಲು ನಾನು ಕೆಲವು ಸೌಲಭ್ಯಗಳನ್ನು ಮತ್ತು ಸಿಬ್ಬಂದಿಗಳನ್ನು ಶೀಘ್ರವಾಗಿ ಮರೆತಿದ್ದೇನೆ. ಎಲ್ಲಾ ಸಿಬ್ಬಂದಿಗಳು ತುಂಬಾ ಮನೋಭಾವ ಹೊಂದಿದ್ದರು. ಒಂದು ಕಳಪೆ: ಗೋಡೆಗಳು ಕಾಗದದ ತೆಳುವಾದವು, ನಿಮಗೆ ಮುಂದಿನ ಮತ್ತು ಹಜಾರದ ಕೋಣೆಗಳಲ್ಲಿ ಪ್ರತಿಯೊಂದು ಶಬ್ದವನ್ನೂ ನೀವು ಅಕ್ಷರಶಃ ಕೇಳಬಹುದು. ನಾನು ಸೂಕ್ತ ಸ್ಥಳಕ್ಕಾಗಿ ಮತ್ತೆ ಇಲ್ಲಿಯೇ ಇರುತ್ತೇನೆ, ಆದರೆ ನಿಮಗೆ ಒಳ್ಳೆಯ ರಾತ್ರಿಗಳು ಬೇಕಾಗಿದ್ದರೆ, ಶಬ್ದದ ಕಾರಣದಿಂದಾಗಿ ಮರುಪರಿಶೀಲಿಸಿ." } ] } } } } ], "status": "success", "metrics": { "elapsedTime": "3.604226917s", "executionTime": "3.604175923s", "resultCount": 6, "resultSize": 20088 } } |
3. Google 자연어 API
자연어 API는 감성 분석, 엔티티 분석, 의도 구문 분석 등을 수행합니다. 이러한 서비스는 서비스에 대한 매개변수를 변경하기만 하면 호출할 수 있습니다.
감성적인 콘텐츠가 있는 호텔 리뷰 데이터를 활용해 봅시다!
|
1 2 3 4 5 6 7 8 9 10 |
SELECT ginfo.review, ginfo.sentscore.documentSentiment.magnitude, ginfo.sentscore.documentSentiment.score FROM ( SELECT r.content AS review, curl("https://language.googleapis.com/v1/documents:analyzeSentiment?key=PUT YOUR KEY HERE", {"request": "POST", "header":"Content-Type: application/json", "data": mydata }) AS sentscore FROM `travel-sample` h USE KEYS "hotel_10142" UNNEST h.reviews r LET mydata = '{ "encodingType": "UTF8", "document": { "type": "PLAIN_TEXT", "content":"' || r.content || '"} }' ) ginfo |
여기에서는 관심 있는 필드, 리뷰, 규모 및 감성 점수만 투영했습니다. 이러한 항목의 의미와 생성되는 나머지 데이터에 대한 자세한 설명은 Google 문서를 참조하세요.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
{ "requestID": "c7b66165-3d18-4a61-8b24-732afdd4714a", "signature": { "magnitude": "json", "review": "json", "score": "json" }, "results": [ { "magnitude": 8.7, "review": "This has got to be the worse experience I have ever had at a hotel. Our reservation was placed two months in advance for a non-smoking room with two beds from July 2-7, 2010. We are staying five nights at $190 a night and this is what we got, a smoking room with one bed, and was only told at the front desk that it was going to be a smoking room, nothing about the one bed, when she asked us how many beds we needed, oh they provided a roll-a-way, only thing is I had to move the chair into the hallway to fit the bed. The t.v. was older than me and the speaker was shot. the bathroom was so small you have to step into the tub to close the door, no fridge in the room, doors are cheap and horrible. only sheets on the bed no blankets/quilts, plus on top of that, i had to pay $14.95 a night for internet. I will never recommend this hotel! how can you take a reservation and state that it will be held till 10am the following morning, yet not provide what was requested in the reservation? What if someone in my party was allergic to smoke, asthmatic, or worse... we wouldn't have gotten a room? completely unacceptable no wonder I will continue to stay at the comfort suites... free internet, modern amenities(flat screens) oh and $85 a night. unsatisfied doesn't even come close to how I feel. the only good thing out of this whole stay was the hot cookie when I got here and mine wasn't even hot. You can take that cookie and... well i'm sure you can figure out the rest. Thanx for nothing!", "score": -0.4 }, { "magnitude": 4.1, "review": "OK - I booked this place about 8 weeks prior to travel, when the rooms were still $116 for a Saturday night on Doubletree/Hilton site. As the travel date drew close, I would reprice and the rate climbed to over $200. $116 was a bargain, but the place isn't worth $200. I had room 1022 - very small, some mildew on in the closet in the corner, and right down the hall from the housekeeping closets (they banged their doors day and night). The bed was comfortable and the staff was very courteous. I didn't know this when I booked the hotel, but I was thrilled to see it was at the same intersection as Harrah's Casino so I lost $50. The hotel is also right at a trolley car stop on Canal Street. $116 - yep, I'ld stay there again in a heartbeat. $200 - no can do. Book early and tolerate the inconveniences in exchange for a bargain price.", "score": 0.1 }, { "magnitude": 4.5, "review": "I was impressed with my room and the great service I received at the front desk. I found the staff helpful and very pleasant. The location was great with easy walking distances to the French Quarter, other points of interest and great restaurants in the immediate area. Room service was on time and my breakfast arrived hot and ready to enjoy. I would recommend this hotel for the start of a great stay in Big Easy.", "score": 0.9 }, { "magnitude": 5.9, "review": "The hotel is located conveniently on Canal Street at the edge of the French Quarter near the river. When we arrived, the rooms were ready to go and checking was painless, the cookies were awesome! The louge downstairs was a good place to catch a drink before heading out each night. We were within walking distance to everything in the French Quarter and catching a cab in front of the hotel was easy. The trolley has a stop in front of the hotel, Harrah's is next door, the aquarium , the mall and a move theater are all across the street. The hotel restaurant was good, not the best considering it's New Orleans, but good for hotel food. I didn't have a car this trip, but you have to pay for parking in most places in the quarter. The pool is small, but nice to hang out at mid afternoon and there is a small gym for a quick work out. I've staryed in many places in the French Quarter over the years and this is one of the better experiences I have had. I was pleasantly suprizes at how much I liked the location.", "score": 0.5 }, { "magnitude": 3.3, "review": "The Doubltree is located near so many attractions, we hardly ever needed a cab the whole time we were there. Clean rooms that were well maintained were a treat to come home to after a long day. I never experienced one issue or problem the entire time I was there, from a warm a welcoming check-in (with a great cookie!) to an efficent check-out. I would certainly reccomend the hotel to anyone I knew that was traveling to the Big Easy.", "score": 0.8 }, { "magnitude": 3.8, "review": "We stayed at the Doubletree Hotel New Orleans for the first time on February 14, 2009. The good: check in was quick, the rooms were comfortable and very clean. I forgot some amenities and staff were very quick to respond with bringing up what I needed. All staff were very polite. One bad: the walls are paper thin, you can literally hear every word in the rooms next to you and in the hallway. I would stay here again for the ideal location, but if you need a good nights rest, reconsider due to noise.", "score": 0.5 } ], "status": "success", "metrics": { "elapsedTime": "3.905025161s", "executionTime": "3.893259752s", "resultCount": 6, "resultSize": 5256 } } |
Google 자연어 API는 엔티티와 해당 웹 참조를 추출할 수도 있습니다. 이에 대한 예시를 살펴보겠습니다.
|
1 2 3 4 5 6 7 8 9 10 |
SELECT ginfo FROM ( SELECT name, content, curl("https://language.googleapis.com/v1/documents:analyzeEntities?key=PUT YOUR KEY HERE", {"request": "POST", "header":"Content-Type: application/json", "data": mydata }) AS sentscore FROM `travel-sample` l USE KEYS "landmark_10087" LET mydata = '{ "encodingType": "UTF8", "document": { "type": "PLAIN_TEXT", "content":"' || l.name || " " || l.content || '"} }' ) ginfo |
엔티티 분석 API는 위치를 정확하게 식별하고 해당 랜드마크에 대한 웹 참조(URL)를 제공합니다. 여기 윌리엄 팀룸처럼 참조가 매우 구체적이지 않은 경우 API는 매우 높은 수준의 일반 참조를 제공할 수 있습니다.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 |
{ "requestID": "4e104224-fe2d-43a8-b86f-aca371987d75", "signature": { "ginfo": "json" }, "results": [ { "ginfo": { "content": "During the temperance movement, the idea of "tearooms", places where you could relax and enjoy non-alcoholic refreshments in differently themed rooms, became popular in Glasgow. This one, designed by Charles Rennie Mackintosh in 1904, was the most popular of its time and has been lovingly restored.", "name": "Willow Tea Rooms", "sentscore": { "entities": [ { "mentions": [ { "text": { "beginOffset": 0, "content": "Willow Tea Rooms" }, "type": "PROPER" }, { "text": { "beginOffset": 83, "content": "places" }, "type": "COMMON" } ], "metadata": { "mid": "/m/0cpvtc", "wikipedia_url": "https://en.wikipedia.org/wiki/Willow_Tearooms" }, "name": "Willow Tea Rooms", "salience": 0.45414653, "type": "LOCATION" }, { "mentions": [ { "text": { "beginOffset": 28, "content": "temperance movement" }, "type": "COMMON" } ], "metadata": {}, "name": "temperance movement", "salience": 0.18415423, "type": "EVENT" }, { "mentions": [ { "text": { "beginOffset": 53, "content": "idea" }, "type": "COMMON" } ], "metadata": {}, "name": "idea", "salience": 0.075759985, "type": "OTHER" }, { "mentions": [ { "text": { "beginOffset": 61, "content": """ }, "type": "COMMON" } ], "metadata": {}, "name": """, "salience": 0.075759985, "type": "OTHER" }, { "mentions": [ { "text": { "beginOffset": 171, "content": "rooms" }, "type": "COMMON" } ], "metadata": {}, "name": "rooms", "salience": 0.059097562, "type": "LOCATION" }, { "mentions": [ { "text": { "beginOffset": 136, "content": "refreshments" }, "type": "COMMON" } ], "metadata": {}, "name": "refreshments", "salience": 0.051312122, "type": "OTHER" }, { "mentions": [ { "text": { "beginOffset": 67, "content": "tearooms"" }, "type": "PROPER" } ], "metadata": { "mid": "/g/11b6hv7vlz", "wikipedia_url": "https://en.wikipedia.org/wiki/Tearoom_(UK_and_US)" }, "name": "tearooms"", "salience": 0.045740306, "type": "ORGANIZATION" }, { "mentions": [ { "text": { "beginOffset": 196, "content": "Glasgow" }, "type": "PROPER" } ], "metadata": { "mid": "/m/0hyxv", "wikipedia_url": "https://en.wikipedia.org/wiki/Glasgow" }, "name": "Glasgow", "salience": 0.028563324, "type": "LOCATION" }, { "mentions": [ { "text": { "beginOffset": 275, "content": "popular" }, "type": "COMMON" } ], "metadata": {}, "name": "popular", "salience": 0.02095558, "type": "OTHER" }, { "mentions": [ { "text": { "beginOffset": 227, "content": "Charles Rennie Mackintosh" }, "type": "PROPER" } ], "metadata": { "mid": "/m/0f7tt", "wikipedia_url": "https://en.wikipedia.org/wiki/Charles_Rennie_Mackintosh" }, "name": "Charles Rennie Mackintosh", "salience": 0.0045103845, "type": "PERSON" } ], "language": "en" } } } ], "status": "success", "metrics": { "elapsedTime": "158.149783ms", "executionTime": "158.101909ms", "resultCount": 1, "resultSize": 8125 } } |
요약:
Couchbase N1QL 애플리케이션은 Google 머신 러닝 API를 쉽게 사용하여 고객 경험을 개선할 수 있습니다. CURL()은 Google뿐만 아니라 다른 공급업체의 인공지능 서비스도 유연하게 사용할 수 있는 방법을 제공합니다. 사용해 보세요.
참조:
1. N1QL: https://docs.couchbase.com/server/5.5/n1ql/n1ql-language-reference/index.html
2. CURL() 문서: https://developer.couchbase.com/documentation/server/current/n1ql/n1ql-language-reference/curl.html
3. CURL이 N1QL에 제공됩니다: https://dzone.com/articles/curl-comes-to-n1ql-querying-external-json-data