Extracting properties and attributes for entities - nlp

I want to extract attributes and their values for name-entities. For example:
Lisa has a pet cat named Whiskers. Whiskers is black with a white spot on her chest. Whiskers also has white paws that look like little white mittens. Whiskers likes to sleep in the sun on her favorite chair. Whiskers also likes to drink creamy milk.
One possible extraction of attributes for each entity is the following:
List:
Has -> Whiskers
Wiskers
Color -> Black
Likes to -> {Sleep in the sun on Lisa's favorite chair, drink creamy mik}

You could search for phrase structures the correspond to the relationships you want to extract. For example, you could find all the phrases of the form Noun-phrase verp-phrase noun-phrase and turn them into subject-predicate-object tuples. The more specific your sentence patterns are, the better this is likely to work. The pattern Python library makes this pretty easy to do.

Related

Full Documentation, i.e. Reference, of Android Material Themes and Styles

I have two specific and several more general questions which are all related to the availability of documentation for material theming in Android.
The general questions are the result of the specific questions.
According to the official docs [1], [2], [3], [4] and blogs [5], [6], [7] about Android Material Theming one should adopt the following theme values for branding
colorPrimary
colorPrimaryVariant
colorOnPrimary
colorSecondary
colorSecondaryVariant
colorOnSecondary
Those are also the values which are preset when one creates a new Android project with the wizard.
According to [2] one should use the Material Color Tool to pick colors, check the colors in various previews and also assess their accessibility, in particular their legibility.
After one has chosen a primary and secondary color, the tool automatically recommends a matching text color as well as a darker and lighter variant for each color.
The problems starts, when one exports the chosen colors to an android XML file.
(The link is in the upper right corner of the Tool).
The exported values are named
primaryColor
primaryLightColor
primaryDarkColor
secondaryColor
secondaryLightColor
secondaryDarkColor
primaryTextColor
secondaryTextColor
Obviously, there is a mismatch in the number and names of the attributes between what the theme expects and what the color tool exports.
Moreover, according to [6] and [8] the primary and secondary color (colorPrimary, colorSecondary) are supposed to be used as background colors (for certain elements of the UI) with foreground elements (such as text) printed on top of them (using colorOnPrimary and colorOnSecondary, resp.).
Also, [6] tells us that the secondary color should preferably be a bright complement to the primary color.
Hence, I decided for a light yellow on which black text is perfectly legible.
However, I had to find out that androidx.preference.PreferenceFragmentCompat uses the secondary color (colorSecondary) as the foreground color of the caption of preference groups on a background which is colored with colorBackground which equals white.
Obviously, a bright yellow on white background is anything but legible.
This leads me to my first two, specific questions
Question 1: How are the colors of the Material Color Picking tool supposed to be mapped onto the theme attributes?
Question 2: Is it correct that the primary and secondary color are also used as text colors on surface background or is this simply a bug in the style used by PreferenceFragmentCompat for captions?
This surprising experience led my to more general questions.
According to the official docs and my understanding views and in particular widgets are governed by styles, e.g. TextAppearance.MaterialComponents.Caption for a TextView which is used as a caption.
These styles do not assign specific values to the attributes which they define, but refer to "semantic" values which act as a placeholder such as colorPrimary and which are defined by a theme.
Then the theme assigns specific values to these semantic values, possibly using another step of indirection, e.g. by referring to named colors.
Assigning custom values to the semantically named values of a theme is supposed to be the main anchor point to adopt a theme like Theme.MaterialComponents.DayNight without the need to redefine all individual styles separately.
However, more or less by accident, I found the styles for TextView such as TextAppearance.MaterialComponents.Caption, TextAppearance.MaterialComponents.Body1.
Again, more or less by accident, I found the theme attributes colorSurface, colorError, colorBackground.
They are listed in the blog 6.
This leads to the following general questions
Question 3: Is there any reference which completely lists all styles which are already defined in by the material design library and explains
what purpose they serve
in which context they should be applied to views (aka widgets)
which subclass of View the style supports (i.e. a edit field, a radio button, etc.)
which semantic attributes of a theme the style uses for what part
Question 4: Is there any reference which completely list all semantic values which are defined by the material design library and explains
their type (i.e. a color, a font size, a dimension)
their intended purpose (e.g. should be light background color)
how they are supposed to interact with other semantic values (e.g. should contrast with color xyz, should be at least be larger than the double of size xyz)
I am thinking of a reference like a typical reference for an API.
I am not looking for the 1000th blog article which again recaps the basic attributes from above.
I already had a look at https://material.io/, but it seems that there is no such thing.

How to join SVG parts into bigger parts?

Well I needed a vector map of The Regions of France, So I did some research and I found this one here :
http://upload.wikimedia.org/wikipedia/commons/7/76/D%C3%A9partements_et_r%C3%A9gions_de_France_vide.svg?uselang=fr
but this one is divided into department, one level more than I need, so I'm trying to join the parts into regions.
Any Idea how to do that easily ?
Thank you
Open the file in a Text editor (e.g. Notepad++) and search and replace #808080 with #f4e2ba. This will make all the thin lines the same color like the background and therefore invisible.

How do I implement a group of strings that starts randomly, but is bound by relevance upon selection?

Okay the title may be a little confusing, but here's what I'm trying to do :) I have a game in XNA where every tap from the user draws a moving circle on the screen. The circle has a tag, say 'dogs' displayed on it. So imagine multiple taps on the screen, and we have all these circles of various colors and sizes moving around the screen with different (but constant) velocities. Each circle with different tags: 'dogs', 'cats' and so on...
Clicking on empty space generates a new circle at that point. Clicking on one of the circles "selects" it, turning it into a greeen shade and slowing its velocity down to a fraction of what it was. Clicking on it again "unselects" it, and restores its original color and velocity (trajectory does not change).
With each circle comes a tag, and as of now I'm populating these tags randomly from a string array (which means there's a chance tags will repeat). I would like the tags for newly created circles to be relevant to previous "selected" tags. So when I click on 'dogs', I would like 'German Shepherd' but I would also like 'dog parks' and 'lemurs' assuming dogs get along well with lemurs.
What would be the best way to approach this problem. In my head I have a massive many-to-many mapping, but I can't seem to translate it to code. Thanks for looking.
FYI I'm using the sample project from here:
http://mobile.tutsplus.com/tutorials/windows/introduction-to-xna-on-windows-phone-7/
At a glance your data structure sounds like a tree, except each node has a list of parents instead of a single parent. You could describe it as many to many like you said, but there's likely more links in the child direction than the parent direction.
Alternatively you could leave it as a tree structure and add a list of associations to nodes, so that like you say lemurs and dogs can be associated, even though they are not in a parent / child relationship.

Which color combination to use on websites?

Just interested in knowing if there are any good (and short! :-) ) articles which talk about the color combinations that would look good on a website.
i.e For tables (odd and even row), which one will be good in all situations
For alerts? For menus? etc
Thanks!
When it comes to colors, I don't think there are any set colors like you ask. There are no articles that say "ALL MENUS MUST BE BLUE!".
For alerts, either a light or golden yellow is used (so that you don't burn your eyes out), or a dark maroon or peachy pink for more prominent alerts. Menus can be any color, but they should match your color scheme.
I think what you are implicitly asking for are color schemes. Take a look at these resources:
Prefab color pallets for inspiration
Color scheme helper chooser
Aviary (Toucan) color chooser (flash)
Visibone color lab
Related articles
How color schemes work
How to choose a color scheme
How to select color combinations
In addition, if you are serious about your website, I strongly STRONGLY suggest reading this book:
Steve Krugs Dont Make Me Think
The book is in an easy to read (and skim) format, and is about colors, interfaces, buttons, and designing the easy-to-use website with lots of pictures and examples. For me, it was a quick read ( < 1 hr), and it changed my life.
simple advise : do not use many colors. select three or max four different color. and work with their shades.
for color scheme selections nothing beats...
http://kuler.adobe.com/

practically most used background colors in web design

I'm customizing a color picker's default showing colors which will be used as background colors. I'm wondering if there is a collection of the colors that are particularly useful in practical web design. Like nobody(hopefully) would use #f00 as a 100%-width page's background color while #fff is a universally usable one, there's DO'S and DONT's when it comes to picking background colors. So what are the candidates in your opinion?
I know this could be subjective, but generally I believe there IS a solid set of them.
[edit] : I kinda have an idea to customize the color picker in a logic way, first pick a buch of hues, them for each hue, start from the possible lightest of saturation to the possible heaviest. A bit demenstration:
gray [ #eee, #ccc, #ddd, .... ]
green [ ... .... ... .... ]
blue ....
yellow
brown [
As for a realistic answer, #fff won the race, right? Sometimes you'll see shades of gray, #eee, #eaeaea, and an occ. #000.
If you want to mix things up, I'd recommend checking out http://kuler.adobe.com/ to get an idea for what's popular, but perhaps slightly different. It's fun to experiment with the palettes up there.
I don't think there is a universal standard for picking up colors for your site. It entirely depends on the nature of the site and the kind of users that visit the site.
For eg: it would be nice to give a greenish color for a site that's theme is nature.
Here is a nice site in which you can choose color combinations and get a preview of that in a single click.
Color Scheme Designer
Never choose a color that will distract the user from seeing the actual contents of the site.
If you allow users to select the color then it would be nice to show them a preview of the site with the colors they have chosen.
Contrast is what really matters when choosing background/foreground colours, so they're likely to be very light, or very dark
so you'll need light and dark variants. i'd probably opt for:
light red, orange, yellow, green, blue, indigo, violet
and dark as above
maybe the same for some earthy type tones, browns, greys, etc.
If you like colours like I do, you might visit ColourLovers. They've got some great ways of choosing colours, and colour schemes. The website trends section might be interesting to you.
I personally like schemes where the lighter colour is not pure white. Pure white can be sometimes harsh when reading lots of text.
Creativity is BREAKING the rules.
It is possible that a seemingly bad color combination, if used in right proportions, can actually look good, so there is no such thing as a bad color combination, it also matters on the shades, difference in colors.
Believe it or not, i own a site (www.salvin.in) where user can change the background color to many different choices and it still manages to look good *ahem in most of the cases.
There are a few things that i suggest you to look into:
Color wheel
Color harmonies
Triads and Tetras
Mono chromes (with contrasting shades)
Complimentaries
I find that #000 messes up my eyes. After looking at mainly #FFF pages/applications, then switch to #000, then when I go back to anything else, it take a while for my eyes to adjust. I vote "no" to #000.

Resources