What tags does Google NL API use in its annotate syntax response? - part-of-speech

I am using Google NL API's annotate syntax method and using Brat to visualize the response. Where can I find the exact list of "Tags" or "Labels" for words and dependency relations that are used in Google NL API.
"partOfSpeech": {
"tag": "ADJ",
"dependencyEdge": {
"headTokenIndex": 9,
"label": "AMOD"

Related

Windchill REST API endpoint to fill BOM from file

We are developing an internal project to use the Windchill OData REST API to fill the eBOM for a given part. What we are trying to do here is to read data from another software we have to get the BOM info and send it to the part in windchill. But we cannot find an endpoint in servlet/odata to do it.
We guess the idea is to replicate the manual process. So we already know how to create, check out and check in a part. However we still cannot find an endpoint to modify the part and add the eBOM.
We know PartList, PartListItem, GetPartStructure in the PTC Product Management Domain. But these are GET endpoints and are only useful to retrieve data, including the BOM. But we cannot use them to modify the content.
I've found the solution.
The endpoint to use is:
POST /ProdMgmt/Parts('VR:wt.part.WTPart:xxxxxxxxx')/Uses
The body of the request must contain:
{
"Quantity": 1,
"Unit": {
"Value": "ea",
"Display": "Each"
},
"TraceCode": {
"Value": "0",
"Display": "Untraced"
},
"Uses#odata.bind": "Parts('OR:wt.part.WTPart:yyyyyyyyy')"
}
Where Uses#odata.bind contains the ID of the part we want to link

Free API/library that allows processing/Iterating/querying Scientific articles (i.e. Google Scholar)?

I'm trying to find a feasible way to iterate over all Scientific Papers on Google Scholar (or any other Scientific library). I do not need the paper content, only Title, Author, Citations & Abstract.
I'm looking for some type of libraries/api's that allow me to iterate and process these papers, as well as something with high querying capabilities.
The only one I found so far is scholarly. It seems pretty good for querying, however, I do not see any option for iterating through everything.
Is there any other web scraping tool that allows me to do that?
Without knowing your specific purpose, it is a bit difficult to give a good response.
But nevertheless, the go-to-place for scientific metadata (e.g. title, authors, citations) would be CrossRef's API. It is free to use.
While I do not know how you determine your sample, you could, for instance, take the ISSN of a journal to fetch metadata about the journal's papers (example here), or you can use a publication's DOI to obtain metadata about that specific paper (example here).
There's a Google Scholar API from SerpApi that supports organic, cite, profile, author results. It bypasses blocks from Google without the need to figure it out by yourself.
Example code to integrate that extracts organic results and full example in the online IDE:
# to scrape profile results, author:
# https://replit.com/#DimitryZub1/Scrape-Google-Scholar-Profile-Results-from-all-Pages#main.py
import json
from serpapi import GoogleScholarSearch
params = {
"api_key": "Your SerpApi API key",
"engine": "google_scholar",
"q": "biology", # search query
"hl": "en" # language
}
search = GoogleScholarSearch(params) # where extraction happens
results = search.get_dict() # JSON -> Python dict
for result in results["organic_results"]:
print(json.dumps(result, indent=2))
# part of the output:
'''
{
"position": 0,
"title": "The biology of mycorrhiza.",
"result_id": "6zRLFbcxtREJ",
"link": "https://www.cabdirect.org/cabdirect/abstract/19690600367",
"snippet": "In the second, revised and extended, edition of this work [cf. FA 20 No. 4264], two new chapters have been added (on carbohydrate physiology physiology Subject Category \u2026",
"publication_info": {
"summary": "JL Harley - The biology of mycorrhiza., 1969 - cabdirect.org"
},
"inline_links": {
"serpapi_cite_link": "https://serpapi.com/search.json?engine=google_scholar_cite&q=6zRLFbcxtREJ",
"cited_by": {
"total": 704,
"link": "https://scholar.google.com/scholar?cites=1275980731835430123&as_sdt=2005&sciodt=0,5&hl=en",
"cites_id": "1275980731835430123",
"serpapi_scholar_link": "https://serpapi.com/search.json?as_sdt=2005&cites=1275980731835430123&engine=google_scholar&hl=en"
},
"related_pages_link": "https://scholar.google.com/scholar?q=related:6zRLFbcxtREJ:scholar.google.com/&scioq=biology&hl=en&as_sdt=0,5",
"versions": {
"total": 4,
"link": "https://scholar.google.com/scholar?cluster=1275980731835430123&hl=en&as_sdt=0,5",
"cluster_id": "1275980731835430123",
"serpapi_scholar_link": "https://serpapi.com/search.json?as_sdt=0%2C5&cluster=1275980731835430123&engine=google_scholar&hl=en"
},
"cached_page_link": "https://scholar.googleusercontent.com/scholar?q=cache:6zRLFbcxtREJ:scholar.google.com/+biology&hl=en&as_sdt=0,5"
}
}
... other results
'''
If you want to scrape data from all available pages, or all publications from a certain author, there is a dedicated Scrape historic Google Scholar results to CSV, SQLite or Scrape all Google Scholar Profile, Author Results to CSV blog posts of mine at SerpApi.
Disclaimer, I work for SerpApi.

How do use REST API in Marketo to add leads as members into Programs?

How do you use REST API in Marketo to add leads as members into programs?
I have created folders, programs and leads using REST API.
Now I want to add specific leads by using their ID into Programs as members.
How do I do it using REST API or do I need to use a different method?
Please let me know.
Use the "Change Lead Program Status" End point: http://developers.marketo.com/rest-api/endpoint-reference/lead-database-endpoint-reference/#!/Leads/changeLeadProgramStatusUsingPOST
Example call:
POST /rest/v1/leads/programs/{programId}/status.json
data={
"status": "Registered",
"input": [
{"id": 123}
]
}
So you can add up to 300 Lead IDs, but only 1 status at a time (for 1 Program).

Is there any way I can get a list of all possible responses from the google vision api?

I am using the google cloud vision api to analyze pictures. Is there a list of all the possible responses for the labelAnnotations method?
The API reference of Vision API gives an overview of all the possible JSON responses for the different image annotation requests.
The labelAnnotation request returns a generic EntityAnnotation response, you can find the JSON representation here, also containing more information about the JSON representation of BoundingPoly, LocationInfo and Property:
{
"mid": string,
"locale": string,
"description": string,
"score": number,
"confidence": number,
"topicality": number,
"boundingPoly": {
object(BoundingPoly)
},
"locations": [
{
object(LocationInfo)
}
],
"properties": [
{
object(Property)
}
],
}
I think you're asking whether you can get a look at the list of possible labels/entities that the Cloud Vision API will detect. If that's the case, the short answer is no, not in any manageable way.
The more complicated answer is sort of, since most labels will have a property for the knowledge graph entry (e.g., {desc: 'dog', mid: '/m/0bt9lr'}). This means that you can look-up more information about the label/entity using the Knowledge Graph API.
While you can't "store a copy" of Google's Knowledge Graph as a list of choices in a drop-down on a page, you can use the API to do a look-up after the Vision API responds with an ID.

Using webhooks with Google Analytics

I'm trying to integrate my CRM with Google Analytics to monitor lead changes (from lead to sell) and so on. As I understood, I need to use Google Measurement Protocol, to receive webhooks from CRM and translate it to Analytics Conversions.
But in fact, I don't really understand how to do it. I need to make some script, to translate webhook code to analytics, but where I need to place that script? Are there some templates? And so on.
So, If you know some tutorials/courses/freelancers to help me with intergrating webhooks with Analytics - I need your advice.
Example of webhook from CRM:
{
"leads": {
"status": {
"id": "25399013",
"name": "Lead title",
"old_status_id": "7039101",
"status_id": "142",
"price": "0",
"responsible_user_id": "102525",
"last_modified": "1413554372",
"modified_user_id": "102525",
"created_user_id": "102525",
"date_create": "1413554349",
"account_id": "7039099",
"custom_fields": [
{
"id": "427183",
"name": "Checkbox custom field",
"values": ["1"]
},
{
"id": "427271",
"name": "Date custom field",
"values": ["1412380800"]
},
{
"id": "1069602",
"name": "Checkbox custom field",
"values": ["0"]
},
{
"id": "427661",
"name": "Text custom field",
"values": ["Валера"]
},
{
"id": "1075272",
"name": "Date custom field",
"values": ["1413331200"]
}
]
}
}
}
"Webhook" is a fancy way of saying that your CRM can call a web based service whenever something interesting happens (i.e. the CRM can "hook" into a web based application). E.g. if a new lead is created you can call an url with the lead details as parameters.
Specifics depend on your CRM, but when you set up a webhook there should be a field to set a url; the script that evaluates the CRM data is located at the URL.
You have that big JSON thing as your example - No real way to tell without knowing your system, but I assume that is sent as request body. So in your script you evaluate the request body, extract the parameters you want to send to analytics (be mindful that you are not allowed to store personally identifiable information) and sent it via the measurement protocol as described in the documentation linked in the other answer.
Depending on the system you might even be able to call the measurement protocol without having a custom script in between (after all the measurement protocol is an url with a few parameters).
This is an awfully generic answer, but then the question is really broad.
I've done just this in my line of work.
You need to first decide your data model on how you would like the CRM data to look within Google Analytics. This could be just mapping Google Analytics' event category, event label, event action to your data, or perhpas using custom dimensions and metrics.
Then to make it most useful, you would like to be able to link the CRM activity of a customer to their online activity. You can do this if they login online. In that case, you can set the cid and/or uid of the user to your CRM id.
Then, if you send in a GA hit with the same cid/uid in your Measurement Protocol hit, you will link the online sessions with your offline CRM activity.
To make the actual record hit Google Analytics, you will need to program something that takes the CRM data and turns it into a Measurement Protocol hit, which is essentially just a URL with the correct parameters. Look here for reference: https://developers.google.com/analytics/devguides/collection/protocol/v1/reference
An example could be: http://www.google-analytics.com/collect?v=1&tid=UA-123456-1&cid=5555&t=pageview&dp=%2FpageA
We usually have this as a seperate process, that fires when the CRM data is written to its database (the webhook in your example). If its a lot of data, you should probably implement checks to see if the hit was sucessful, and caching in case the service is not online - you have an optional parameter that gives you 4 hours leeway in sending data.
Hope this gets you at least started.

Resources