Google automl translate with tags - google-cloud-automl

I have created a custom Model with Google AutoML. And I would like to use some "tags" such has and make sure it doesn't get translated by Google AutoML. I expect that these tags would be copied as is in the target language at the corresponding place. `
Is there such a feature? I didn't find anything in their documentation.
Example:
The dog is walking <tag> outside. --- > Le chien marche <tag> dehors.

I finally found the answer.
You first need to specify "text/html" as mime_type in your request.
And you need to put any text you want to keep as is between these tags:
(you can use any of the two ways)
<span translate="no">Your text</span>
<span class="notranslate">Your text</span>

Related

Structured-Data > Microdata > Schema > Article > Author Itemscope > Properties > Google Validation Error

I am developing my own site locally. This is my first site so I am a relative 'noob'.
I have begun the process of marking up my site with the microdata format using the schema.org vocabulary.
I am using Google's structured data tester to test my microdata markup.
On a webpage I have marked up an article.
THE PROBLEM
I am getting errors for all properties for a person itemscope successfully connected to the article itemscope. It does not matter how the person is linked, whether as author or creator or otherwise.
For example, if I link a person to the article using the author property and try to then mark up their name with the name property, it gives a red error roughly like so:
!
http://www.example.com/name: Name
Where the property name is the cited in a url/property format, and where 'Name' is the property value I actually want.
If I then click on the error message, it says:
The property http://www.example.com/name is not recognised by Google
for an object of type Thing.
It is otherwise:
showing the other article properties fine; and
creating an person-type property for the article fine (eg author, creator, etc); and
creating name:value pairs for properties of the person (eg name).
But it just doesn't recognise the properties of the person.
MARKUP SAMPLE
Here is a sample of how I am marking it up:
<html>
...
<div itemprop="hasPart" itemscope="itemscope" itemtype="https://schema.org/Article">
<h1 itemprop="headline name">
Awesome Things
</h1>
<div itemprop="articleBody">
Blah blah blah ... FLUFFY KITTENS ... blah blah blah ... DONUTS ... blah blah blah ... COFFEE!!! ...
AUTHOR:
<span itemprop="author" itemscope="itemscope" itemptype="https://schema.org/Person">
<span itemprop="name">
Joe Blogs-a-Lot
</span>
</span>
</div>
...
</div>
</html>
TRIED
I have tried testing with alternate properties with person as an expected type (author and creator). Same result.
I have also tried wrapping person itemscope around the properties, and using itemref and ID to target the values. This works, but has the downside of adding those values to properties in common with the article. So, for example, the article gets the additional name value of Joe Blogs-a-Lot - which isn't correct.
INVESTIGATIONS
I have had a bit of a look-see but couldn't quite find a specific answer - which surprised me.
I did notice that there were reports of issues with the testing tool. For example, I note this answer from the AWESOME CONTRIBUTOR in this area, the mighty #unor. If you see this, Unor, thanks for all the help you have provided to so many people here about this stuff. You rock.
THE ACTUAL QUESTION
Am I doing something dumb (a distinct possibility from past experience), or is this an issue with the tester?
Your markup sample contains a typo:
itemptype="https://schema.org/Person"
should be
itemtype="https://schema.org/Person"
Unfortunately, the Google Structured Data Testing Tool doesn’t report such errors. (And they shouldn’t have interpreted the property name as the URL http://www.example.com/name, because an item without a type could have a proprietary item property name, which would not be a URL.)
On a side note: You might want to use http instead of https for the Schema.org URLs.

CKEDITOR's source code mode scrambles custom template code

I'm trying to allow custom "template code" within the source code editor. My code snippets would always look like {* anything here *}. It mostly works, but if used inside an HTML tag things gets scrambled.
I'm already using allowedContent: true, when starting CKEDITOR.
Example:
<p style="{* some "short code" of mine... *}">Text</p>
turns into
<p style="{* some " short="" code"="" of="" mine...="" *}"="">Text</p>
And
<p {* tet_pos_is_inside *}>Fuss</p>
into
<p {*="" tet_pos_is_inside="" *}="">Fuss</p>
Any advise ?
Thanks,
Sebastian
My advise would be to never use them inside tags, it sounds like a nightmare to configure. What is the requirement you are trying to fill with those?
You could go around this issue with pre- and post processing using classes, data attributes and/or custom attributes. For example you could use something like his:
<p class="tet_pos_is_inside_val-12345 foo-val-12345">I love horses</p>
<p data-tet_pos_is_inside="12345" data-foo="">I love bunnies</p>
<p tet_pos_is_inside="12345" foo="">I love cats</p>
Well,
apparently there was a simple solution to solve my current problem:
<p style="{* some 'short code' of mine... *}">Text</p>
works ! Note the use of singe-quotes inside the double quotes.
IOW, as long as there is a <tag attr="val"> then val can be anything except containing more double quotes.
Thanks for the comments.

How to add content tags in all articles (Joomla)

I have found a great plugin that sets Facebook comments on an article where you write down {fcomment}.
The problem with this is that you have to manually put this in each article, what is time consuming work.
Is there a method to put specific content in header / footer (in this case {fcomment) that display Facebook comments) of each article?
Thanks
Use ReReplacer and then match some part of the article html and add your custom tag, like:
Match: <span class="article_separator"> </span>
Change to: {fcomment}<span class="article_separator"> </span>

Avoiding duplicate-content hit on Google for archive pages?

Each blog post on my site -- http://www.correlated.org -- is archived at its own permalinked URL.
On each of these archived pages, I'd like to display not only the archived post but also the 10 posts that were published before it, so that people can get a better sense of what sort of content the blog offers.
My concern is that Google and other search engines will consider those other posts to be duplicate content, since each post will appear on multiple pages.
On another blog of mine -- http://coding.pressbin.com -- I had tried to work around that by loading the earlier posts as an AJAX call, but I'm wondering if there's a simpler way.
Is there any way to signal to a search engine that a particular section of a page should not be indexed?
If not, is there an easier way than an AJAX call to do what I'm trying to do?
Caveat: this hasn't been tested in the wild, but should work based on my reading of the Google Webmaster Central blog and the schema.org docs. Anyway...
This seems like a good use case for structuring your content using microdata. This involves marking up your content as a Rich Snippet of the type Article, like so:
<div itemscope itemtype="http://schema.org/Article" class="item first">
<h3 itemprop="name">August 13's correlation</h3>
<p itemprop="description" class="stat">In general, 27 percent of people have never had any wisdom teeth extracted. But among those who describe themselves as pessimists, 38 percent haven't had wisdom teeth extracted.</p>
<p class="info">Based on a survey of 222 people who haven't had wisdom teeth extracted and 576 people in general.</p>
<p class="social"><a itemprop="url" href="http://www.correlated.org/153">Link to this statistic</a></p>
</div>
Note the use of itemscope, itemtype and itemprop to define each article on the page.
Now, according to schema.org, which is supported by Google, Yahoo and Bing, the search engines should respect the canonical url described by the itemprop="url" above:
Canonical references
Typically, links are specified using the element. For example, the
following HTML links to the Wikipedia page for the book Catcher in the
Rye.
<div itemscope itemtype="http://schema.org/Book">
<span itemprop="name">The Catcher in the Rye</span>—
by <span itemprop="author">J.D. Salinger</a>
Here is the book's <a itemprop="url"
href="http://en.wikipedia.org/wiki/The_Catcher_in_the_Rye">Wikipedia
page.
http://schema.org/docs/gs.html#advanced_enum
So when marked up in this way, Google should be able to correctly ascribe which piece of content belongs to which canonical URL and weight it in the SERPs accordingly.
Once you've done marking up your content, you can test it using the Rich Snippets testing tool, which should give you a good indication of what Google things about your pages before you roll it into production.
p.s. the most important thing you can do to avoid a duplicate content penalty is to fix the titles on your permalink pages. Currently they all read 'Correlated - Discover surprising correlations' which will cause your ranking to take a massive hit.
I'm afraid but I think it is not possible to tell a Search Engine that a specif are of your web page should not be be indexed (example a div in your HTML source). A solution to this would be to use an Iframe for the content you do not what search engine to index, so I would use a robot.text file with an appropriate tag Disallow to deny access to that specific file linked to the Iframe.
You can't tell Google to ignore portions of a web page but you can serve up that content in such a way that the search engines can't find it. You can either place that content in an <iframe> or serve it up via JavaScript.
I don't like those two approaches because they're hackish. Your best bet is to completely block those pages from the search engines since all of the content is duplicated anyway. You can accomplish that a few ways:
Block your archives using robots.txt. If your archives in are in their own directory then you can block the entire directory easily. You can also block individual files and use wildcards to match patterns.
Use the <META NAME="ROBOTS" CONTENT="noindex"> tag to block each page from being indexed.
Use the X-Robots-Tag: noindex HTTP header to block each page from being indexed by the search engines. This is identical in effect to using the ` tag although this one can be easier to implement since you can use it in a .htaccess file and apply it to an entire directory.

Blogger template: Style blog post based on label

I'm trying to change the style of a blog post (for instance change the title color), based on the labels associated to the post.
I'm a bit new to the templating, so I though I would be going to add a class with the label in the title <h3> element, and then add my CSS rules.
So I found this which would generate a proper list of labels separated by a space:
<b:loop values='data:post.labels' var='label'><data:label.name/> </b:loop>
However, it seems the validator does not let me add this inside the class attribute as follow:
<h3 class='post-title entry-title <b:loop values="data:post.labels" var="label"><data:label.name/> </b:loop>'>
From there, I found half the solution. Apparently, I should use expr:class instead of class as follow:
<h3 expr:class='"post-title entry-title " + data:list_of_labels'>
So now:
- How can I build this variable data:list_of_labels? (basically how to set a variable)
- Is there a full description of the template syntax somewhere?
- Is there another way to go around this?
Thanks,
JB
This should do it. Using XML entities allows you bypass the XML validation and move the Blogger functions to where you need them. Longer explanation here: http://www.karlhorky.com/2012/06/add-blogger-labels-to-post-as-css.html
<div class="post<b:if cond="data:post.labels"><b:loop values="data:post.labels" var="label"> <data:label.name></data:label.name></b:loop></b:if>">
<data:post.body>
</div>
There is no way to set variables in the blogger data xml, however you can set variables using javascript.
There are many pages on the blogger data xml. Google is your friend. For example this one.
You are on the right track: do a loop, use javascript to check for the combinations you want, change the style properties or load a css file dynamically.

Resources