Coder Social home page Coder Social logo

azure-samples / azure-search-python-samples Goto Github PK

View Code? Open in Web Editor NEW
62.0 26.0 223.0 2.05 MB

Azure Search Python sample code

License: MIT License

Jupyter Notebook 42.81% Python 18.05% Dockerfile 3.40% HTML 2.14% CSS 3.64% JavaScript 29.97%

azure-search-python-samples's Introduction

Python samples for Azure AI Search

This repository contains Python code samples used in Azure AI Search documentation. Unless noted otherwise, all samples run on the shared (free) pricing tier of an Azure AI Search service.

Sample Description
quickstart "Day One" introduction to the fundamental tasks of working with a search index: create, load, and query. This sample is a notebook .ipynb file. The index is modeled on a subset of the Hotels dataset, widely used in Azure AI Search samples, but reduced here for readability and comprehension.
quickstart-semantic-search Extends the quickstart through modifications that invoke semantic search. This notebook adds a semantic configuration to the index and semantic query options that formulate the query and response.
search-website-functions-v4 Shows how to create, load, and query a search index in Python using the Azure.Search.Documents library in the Azure SDK for Python. It also includes application code and sample data so that you can see search integration in the context of a full app. The data is from https://github.com/zygmuntz/goodbooks-10k. The app is an Azure Static Web app, using the React library for user interaction, and Azure Function to handle the query requests and responses in the application layer.

Archived samples

azure-search-python-samples's People

Contributors

dependabot[bot] avatar dereklegenzoff avatar diberry avatar heidisteen avatar jimacoms4 avatar kjaymiller avatar liamca avatar lisaleib avatar microsoftopensource avatar msftgits avatar supernova-eng avatar tchristiani avatar tonybaloney avatar tsukashusan avatar vkurpad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-search-python-samples's Issues

A resource without a type name was found,

r = requests.post(construct_Url(search_service, "indexers", None, None, api_version), data=json.dumps(indexer_def), headers=headers)
<Response [400]>
{
"error": {
"code": "",
"message": "The request is invalid. Details: indexer : A resource without a type name was found, but no expected type was specified. To allow entries without type information, the expected type must also be specified when the model is specified.\r\n"
}
}

ImportError: cannot import name 'PrioritizedFields' from 'azure.search.documents.indexes.models'

# Uncomment the next line if you need to install the azure-search-documents client library:
%pip install azure-search-documents --pre
%pip show azure-search-documents
%pip install python-dotenv

import os
from azure.core.credentials import AzureKeyCredential
from azure.search.documents.indexes import SearchIndexClient 
from azure.search.documents import SearchClient
from azure.search.documents.indexes.models import (  
    SearchIndex,  
    SearchField,  
    SearchFieldDataType,  
    SimpleField,  
    SearchableField,
    ComplexField,
    SearchIndex,  
    SemanticConfiguration,  
    PrioritizedFields,  
    SemanticField,  
    SemanticSettings,  
)

Error:

ImportError: cannot import name 'PrioritizedFields' from 'azure.search.documents.indexes.models'

Code File:
https://github.com/Azure-Samples/azure-search-python-samples/blob/main/Quickstart-Semantic-Search/semantic-search-quickstart.ipynb?short_path=c3ace9a#L43

Static Web APP deployment

In the README, there is a step by step description on how to deploy a Static Web APP from Visual Studio Code using the respective plug-in. The order has been updated in the plugin for static website creation, hence the description in the repo is outdated

Custom Skill Tutorial Does not Work in AML

I believe the files need to be updated so that it can be used in the AML environment.

  1. git+https://github.com/NervanaSystems/nlp-architect.git@absa no longer exists (see message error below)
  2. I got a rng library error and needed to update numpy
  3. I had to use .amlignore to exempt the large model .zip file because it was too large for snapshot
  4. I get a BadZipFile error that I cannot resolve (see message error below)

Git Error:

Collecting git+https://github.com/NervanaSystems/nlp-architect.git@absa
Cloning https://github.com/NervanaSystems/nlp-architect.git (to revision absa) to /tmp/pip-req-build-gn4sfh9l
Running command git clone -q https://github.com/NervanaSystems/nlp-architect.git /tmp/pip-req-build-gn4sfh9l
WARNING: Did not find branch or tag 'absa', assuming revision or ref.
Running command git checkout -q absa
error: pathspec 'absa' did not match any file(s) known to git
ERROR: Command errored out with exit status 1: git checkout -q absa Check the logs for full command output.
Note: you may need to restart the kernel to use updated packages.

Zip File Error

Log Output

You can now load the model via spacy.load('en')
Using pre-trained BIST model.
Downloading pre-trained BIST model...
Unable to determine total file size.
Downloading file to: /root/nlp-architect/cache/bist-pretrained/bist-pretrained.zip

0MB [00:00, ?MB/s]
1MB [00:00, 579.96MB/s]
Download Complete
Unzipping...

[2021-04-05T14:57:17.529886] The experiment failed. Finalizing run...
2021-04-05 14:57:17,535 INFO Exiting context: TrackUserError
2021-04-05 14:57:17,536 INFO Exiting context: RunHistory
Cleaning up all outstanding Run operations, waiting 900.0 seconds
1 items cleaning up...
Cleanup took 0.07420921325683594 seconds
2021-04-05 14:57:30,901 INFO Exiting context: ProjectPythonPath
Traceback (most recent call last):
File "train.py", line 46, in
max_iter=args.max_iter)
File "/azureml-envs/azureml_d664de2764d55f1b5c7b6f4fc0a2fd6b/lib/python3.6/site-packages/nlp_architect/models/absa/train/train.py", line 49, in init
self.parser = SpacyBISTParser()
File "/azureml-envs/azureml_d664de2764d55f1b5c7b6f4fc0a2fd6b/lib/python3.6/site-packages/nlp_architect/pipelines/spacy_bist.py", line 46, in init
_download_pretrained_model()
File "/azureml-envs/azureml_d664de2764d55f1b5c7b6f4fc0a2fd6b/lib/python3.6/site-packages/nlp_architect/pipelines/spacy_bist.py", line 170, in _download_pretrained_model
uncompress_file(zip_path, outpath=str(SpacyBISTParser.dir))
File "/azureml-envs/azureml_d664de2764d55f1b5c7b6f4fc0a2fd6b/lib/python3.6/site-packages/nlp_architect/utils/io.py", line 85, in uncompress_file
with zipfile.ZipFile(filepath) as z:
File "/azureml-envs/azureml_d664de2764d55f1b5c7b6f4fc0a2fd6b/lib/python3.6/zipfile.py", line 1108, in init
self._RealGetContents()
File "/azureml-envs/azureml_d664de2764d55f1b5c7b6f4fc0a2fd6b/lib/python3.6/zipfile.py", line 1175, in _RealGetContents
raise BadZipFile("File is not a zip file")
zipfile.BadZipFile: File is not a zip file

Failed to establish a new connection

I'm using python 3.7 and the admin_key:
<urllib3.connection.HTTPSConnection object at 0x0000015B49BF2588>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed

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.